[U-Boot] [PATCH] USB: gadget: atmel: disconnect before unbind

Bo Shen voice.shen at atmel.com
Tue Sep 24 07:19:24 CEST 2013


When unbind the gadget driver, need call disconnect first.

Signed-off-by: Bo Shen <voice.shen at atmel.com>

---
 drivers/usb/gadget/atmel_usba_udc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index f146c48..c99208d 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1240,11 +1240,12 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
 	struct usba_udc *udc = &controller;
 
-	if (!driver || !driver->bind || !driver->setup) {
+	if (!driver || !driver->unbind || !driver->disconnect) {
 		error("bad paramter\n");
 		return -EINVAL;
 	}
 
+	driver->disconnect(&udc->gadget);
 	driver->unbind(&udc->gadget);
 	udc->driver = NULL;
 
-- 
1.7.9.5



More information about the U-Boot mailing list