From: Vladimir Zapolskiy Date: Fri, 18 Jun 2010 04:25:00 +0000 (+0400) Subject: USB: s3c2410: deactivate endpoints before gadget unbinding X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3b49d2315c119b9ae8a9a33b07d4eb7d194c01a7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- 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) 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);