diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-06-16 20:36:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-01 14:31:07 -0700 |
commit | 719e52cbc7b826fae9501f3b86b8cbc25a4c5268 (patch) | |
tree | a34296697d8f9e26791663e919c88ab0e186240a /drivers/usb/gadget/dummy_hcd.c | |
parent | 99fd14080e7f0a65b87830bf5062b09f6e80dd13 (diff) |
usb: gadget: dummy_hcd: use gadget_to_dummy_hcd() where possible
gadget_to_dummy_hcd() already does the speed check, so
it's unnecessary to unroll that all the time.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 834fb923a06..1fc80bb8ca3 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -429,10 +429,8 @@ dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) dum = ep_to_dummy (ep); if (!dum->driver) return -ESHUTDOWN; - if (dum->gadget.speed == USB_SPEED_SUPER) - dum_hcd = dum->ss_hcd; - else - dum_hcd = dum->hs_hcd; + + dum_hcd = gadget_to_dummy_hcd(&dum->gadget); if (!is_enabled(dum_hcd)) return -ESHUTDOWN; @@ -631,10 +629,7 @@ dummy_queue (struct usb_ep *_ep, struct usb_request *_req, return -EINVAL; dum = ep_to_dummy (ep); - if (dum->gadget.speed == USB_SPEED_SUPER) - dum_hcd = dum->ss_hcd; - else - dum_hcd = dum->hs_hcd; + dum_hcd = gadget_to_dummy_hcd(&dum->gadget); if (!dum->driver || !is_enabled(dum_hcd)) return -ESHUTDOWN; |