Commit 719e52cb authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Greg Kroah-Hartman

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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 99fd1408
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment