提交 d855e08c 编写于 作者: R Roger Quadros 提交者: Felipe Balbi

USB: dummy-hcd: Adapt dummy_udc_set_speed()

The UDC core ensures that .udc_set_speed() is called with
a speed that is a minimum of the max speeds supported
by the gadget function driver and the UDC driver.

We can now use the speed argument as is.

Get rid of the debug print as that condition will never happen.
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NRoger Quadros <rogerq@ti.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 8ea40904
...@@ -925,20 +925,8 @@ static void dummy_udc_set_speed(struct usb_gadget *_gadget, ...@@ -925,20 +925,8 @@ static void dummy_udc_set_speed(struct usb_gadget *_gadget,
struct dummy *dum; struct dummy *dum;
dum = gadget_dev_to_dummy(&_gadget->dev); dum = gadget_dev_to_dummy(&_gadget->dev);
dum->gadget.speed = speed;
if (mod_data.is_super_speed)
dum->gadget.speed = min_t(u8, USB_SPEED_SUPER, speed);
else if (mod_data.is_high_speed)
dum->gadget.speed = min_t(u8, USB_SPEED_HIGH, speed);
else
dum->gadget.speed = USB_SPEED_FULL;
dummy_udc_update_ep0(dum); dummy_udc_update_ep0(dum);
if (dum->gadget.speed < speed)
dev_dbg(udc_dev(dum), "This device can perform faster"
" if you connect it to a %s port...\n",
usb_speed_string(speed));
} }
static int dummy_udc_start(struct usb_gadget *g, static int dummy_udc_start(struct usb_gadget *g,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册