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>
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;
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;