提交 3b49d231 编写于 作者: V Vladimir Zapolskiy 提交者: Greg Kroah-Hartman

USB: s3c2410: deactivate endpoints before gadget unbinding

Gadget disconnect must be called before unbinding to avoid races.
The change fixes an oops on g_ether module unregistering.
Signed-off-by: NVladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4c9715de
......@@ -1700,9 +1700,13 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
if (!driver || driver != udc->driver || !driver->unbind)
return -EINVAL;
dprintk(DEBUG_NORMAL,"usb_gadget_register_driver() '%s'\n",
dprintk(DEBUG_NORMAL, "usb_gadget_unregister_driver() '%s'\n",
driver->driver.name);
/* report disconnect */
if (driver->disconnect)
driver->disconnect(&udc->gadget);
driver->unbind(&udc->gadget);
device_del(&udc->gadget.dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册