aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vzapolskiy@gmail.com>2010-06-18 00:25:00 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-30 11:16:06 -0400
commit3b49d2315c119b9ae8a9a33b07d4eb7d194c01a7 (patch)
treee1c0ab9b91219a1719d52c6fc824799139df0f9d /drivers/usb
parent4c9715de52b9b6256bf1e9510917111a47b0c176 (diff)
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: Vladimir Zapolskiy <vzapolskiy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index d5f4c1d45c97..e724a051bfdd 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1700,9 +1700,13 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
1700 if (!driver || driver != udc->driver || !driver->unbind) 1700 if (!driver || driver != udc->driver || !driver->unbind)
1701 return -EINVAL; 1701 return -EINVAL;
1702 1702
1703 dprintk(DEBUG_NORMAL,"usb_gadget_register_driver() '%s'\n", 1703 dprintk(DEBUG_NORMAL, "usb_gadget_unregister_driver() '%s'\n",
1704 driver->driver.name); 1704 driver->driver.name);
1705 1705
1706 /* report disconnect */
1707 if (driver->disconnect)
1708 driver->disconnect(&udc->gadget);
1709
1706 driver->unbind(&udc->gadget); 1710 driver->unbind(&udc->gadget);
1707 1711
1708 device_del(&udc->gadget.dev); 1712 device_del(&udc->gadget.dev);