diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2011-11-19 12:26:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-29 09:19:04 -0500 |
commit | bfe0658b402dab3d6fbef4b7bd81a46d0e68eb86 (patch) | |
tree | 8fdc002151177e1cfb7ea1b30dd54d7a09bec96b /drivers/usb/musb | |
parent | fef6964452abae55c82e1615ac505b8377df00e9 (diff) |
usb: udc: Fix gadget driver's speed check in various UDC drivers
Several UDC drivers had a gadget driver's speed sanity check of the
form of:
driver->speed != USB_SPEED_HIGH
or:
driver->speed != USB_SPEED_HIGH && driver->speed != USB_SPEED_FULL
As more and more gadget drivers support USB SuperSpeed, driver->speed
may be set to USB_SPEED_SUPER and UDC driver should handle such gadget
correctly. The above checks however fail to recognise USB_SPEED_SUPER
as a valid speed.
This commit changes the two checks to:
driver->speed < USB_SPEED_HIGH
or:
driver->speed < USB_SPEED_FULL
respectively.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index d51043acfe1a..922148ff8d29 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1903,7 +1903,7 @@ static int musb_gadget_start(struct usb_gadget *g, | |||
1903 | unsigned long flags; | 1903 | unsigned long flags; |
1904 | int retval = -EINVAL; | 1904 | int retval = -EINVAL; |
1905 | 1905 | ||
1906 | if (driver->speed != USB_SPEED_HIGH) | 1906 | if (driver->speed < USB_SPEED_HIGH) |
1907 | goto err0; | 1907 | goto err0; |
1908 | 1908 | ||
1909 | pm_runtime_get_sync(musb->controller); | 1909 | pm_runtime_get_sync(musb->controller); |