diff options
author | Ingo van Lil <inguin@gmx.de> | 2008-03-28 14:50:26 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-24 21:16:47 -0700 |
commit | 9063ff44f081a0297085952f6760dfe1f8ca840e (patch) | |
tree | 77e921cc3fad2951b98d6aea872fc644bdf290b9 /drivers/usb | |
parent | 73d79aaba9ee21aaa1a6676f568ef7b3bdf993ea (diff) |
USB: gadget: dummy_hcd.c: fix nested switch statements
Fix a messed up combination of two nested switch statements in
drivers/usb/gadget/dummy_hcd.c.
According to the USB spec (section 5.8.3) the maximum packet size for bulk
endpoints can be 512 for high-speed devices and 8, 16, 32 or 64 for full-speed
devices. Low-speed devices must not have bulk endpoints.
Signed-off-by: Ingo van Lil <inguin@gmx.de>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index e454775c2ff2..433f8c47cce5 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -365,16 +365,14 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) case USB_SPEED_HIGH: if (max == 512) break; - /* conserve return statements */ - default: - switch (max) { - case 8: case 16: case 32: case 64: + goto done; + case USB_SPEED_FULL: + if (max == 8 || max == 16 || max == 32 || max == 64) /* we'll fake any legal size */ break; - default: - case USB_SPEED_LOW: - goto done; - } + /* save a return statement */ + default: + goto done; } break; case USB_ENDPOINT_XFER_INT: |