Commit Graph

11 Commits

Author SHA1 Message Date
Alexey Khoroshilov 966036fde6 usb: gadget: gr_udc: unconditionally use GFP_ATOMIC in gr_queue_ext()
As far as gr_queue() is called with spinlock held,
we have to pass GFP_ATOMIC regardless of gfp argument.

Found by Linux Driver Verification project (linuxtesting.org).

Acked-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-05-14 09:23:30 -05:00
Andreas Larsson 8652bcbfa0 usb: gadget: gr_udc: Use GFP_ATOMIC when allocating under held spinlock
As gr_ep_init must be called with dev->lock held, GFP_KERNEL must not be used.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:28 -05:00
Andreas Larsson b38d27e552 usb: gadget: gr_udc: Return error code when trying to set ep.maxpacket > ep.maxpacket_limit
Make gr_ep_enable fail properly when a call requests a larger ep.maxpacket than
ep.maxpacket_limit.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:27 -05:00
Andreas Larsson 5bddbd72c6 usb: gadget: gr_udc: Add ep.maxpacket_limit to debugfs information
Add information on ep.maxpacket_limit for each endpoint in the debugfs
information.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:27 -05:00
Andreas Larsson 73e1c093e8 usb: gadget: gr_udc: Use of_property_read_u32_index to access arrays
Use an appropriate accessor function for property arrays to make the code nicer
and make the code correct if it would ever run on little endian architectures.
Suggested by Mark Rutland.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:27 -05:00
Andreas Larsson 196800da39 usb: gadget: gr_udc: Use platform_get_irq instead of irq_of_parse_and_map
Use platform_get_irq as no mapping needs to be done. No functional difference
for SPARC which is the typical environment for the driver though. Suggested by
Mark Rutland.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:26 -05:00
Andreas Larsson 22876266de usb: gadget: gr_udc: improve platform_device variable name
Rename struct platform_device pointers from ofdev to pdev for clarity,
while at that, also use platform_set/get_drvdata() helpers.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-04-21 14:07:26 -05:00
Dan Carpenter 798a2468e0 usb: gadget: gr_udc: remove some unneeded error handling
Debugfs function return an ERR_PTR if they compiled out.  We don't need
to test for that here because if the debugfs file are compiled out then
it is ok to pass an ERR_PTR to debugfs_create_file() since it will just
be a no-op stub.

Debugfs return NULLs on error, but we don't need to test for that either
because debugfs_create_file() will accept NULL pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-02-20 09:16:17 -06:00
Paul Gortmaker 803a536243 usb: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:01:39 -08:00
Wei Yongjun d85b277ed1 usb: gadget: remove unused variable in gr_queue_int()
The variable 'dev' is initialized but never used
otherwise, so remove the unused variable.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-07 16:30:25 -08:00
Andreas Larsson 27e9dcc924 usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC
This adds an UDC driver for GRUSBDC USB Device Controller cores available in the
GRLIB VHDL IP core library. The driver only supports DMA mode.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-12-23 19:26:13 -06:00