usb: gadget: Avoid static allocated variables

Replaced static allocated variable with devm_kzalloc

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Updated copyright

Moved copyright to be in ascending order

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Removed DRIVER_VERSION

Driver version is not required hence removed

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Fixed coding style issues

 - Removed unnecessary intializers
 - Removed extra paranthesis
 - modified for proper indentation

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Removed ioctl function

Set device in Test Mode by writing to Test Mode
register during setup packet processing, ioctl
function is not required.

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Removed DEVICE_REMOTE_WAKEUP

Check for DEVICE_REMOTE_WAKEUP is not required for this
IP.

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Modified xudc_probe to use request_irq

 - Use request_irq instead of devm_request_irq
 - return probe failure when udc_add_gadget fails

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Removed function declarations

Moved functions to avoid function declarations

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Renamed functions to prefix xudc_

Renamed functions with prefix xudc_

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Modified comments and fixed doc warnings

Modified incorrect, unnecessary comments and fixed doc warnings

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: gadget: Rearrange structure members

Rerranged structure members not to waste memory

Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
usb: ehci-zynq: Fix dead-lock

Looks like starting with commit commit c04ee4b11 ("Revert "Revert "USB: EHCI:
support running URB giveback in tasklet context") it is necessary to set the
HCD_BH flag on EHCI drivers, otherwise the system will dead-lock when plugging
in a USB device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
spi: xilinx: Convert to let spi core validate bits_per_word

Set bits_per_word_mask so spi core will reject transfers that attempt to use
an unsupported bits_per_word value.

spi_bitbang requires custom setup_transfer() to be defined if there is a
custom txrx_bufs(). Thus keep the empty xilinx_spi_setup_transfer() function
in the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
APF: Check 'copy_to_user' return value

Check the return value of 'copy_to_user' and if it is
non-zero, return -EFAULT
This is to fix build warnings reported by kbuild test robot
drivers/staging/apf/xlnk.c: In function 'xlnk_dmarequest_ioctl':
	drivers/staging/apf/xlnk.c:838:14:
	warning: ignoring return value of 'copy_to_user',
	declared with attribute warn_unused_result [-Wunused-result]
drivers/staging/apf/xlnk.c: In function 'xlnk_dmasubmit_ioctl':
	drivers/staging/apf/xlnk.c:883:15:
	warning: ignoring return value of 'copy_to_user',
	declared with attribute warn_unused_result [-Wunused-result]
drivers/staging/apf/xlnk.c: In function 'xlnk_dmawait_ioctl':
	drivers/staging/apf/xlnk.c:915:15:
	warning: ignoring return value of 'copy_to_user',
	declared with attribute warn_unused_result [-Wunused-result]
drivers/staging/apf/xlnk.c: In function 'xlnk_dump_events':
	drivers/staging/apf/xlnk.c:1280:14:
	warning: ignoring return value of 'copy_to_user',
	declared with attribute warn_unused_result [-Wunused-result]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: S Mohan <s.mohan@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: cadence: Handle interruption during transfer

Waiting for a transfer to finish is implemented using 'wait_for_completion_interruptible_timeout()'. But the return value is not properly checked resulting in following bug:
  The wait_for_completion_interruptible_timeout() call will return
  -ERESTARTSYS when the process is interrupted (e.g. ^C) but the code
  doesn't check for this. So the i2c_transfer() call will return len > 0
  and falsely indicate the transfer succeeded!

Reported-by: Andrew Worsley <amworsley@gmail.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Reviewed-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
I2C: cadence: Reduced I2C timeout

Reduced CDNS_I2C_TIMEOUT from 50 seconds to 2 seconds.
It is about twice the estimation for 1KB data @ 100KHz.

Reported-by: Andrew Worsley <amworsley@gmail.com>
Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>