Hi, the attached patch fixes bug #2240 (removing/reloading g_ether not working) by adding an (apparently) forgotten call to unbind(). Comments are welcome, I don't even pretend to know much about how usb gadget stuff is supposed to work :-)
commit 5225d700201bf22ea4c447066b2e4fc1dc20dcb1 Author: Timo Juhani Lindfors <[email protected]> Date: Tue Apr 28 19:59:03 2009 +0300 Call unbind() hook of the gadget so that it can properly release its resources. This fixes bug http://docs.openmoko.org/trac/ticket/2240 ("removing/reloading g_ether not working"). All other instances of usb_gadget_unregister_driver in Linux already call unbind() so it is bit odd s3c2410_udc.c did not do so. diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 1a185c1..891bab7 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c @@ -1713,6 +1713,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) if (driver->disconnect) driver->disconnect(&udc->gadget); + driver->unbind(&udc->gadget); device_del(&udc->gadget.dev); udc->driver = NULL;
best regards, Timo Lindfors
