]> git.sur5r.net Git - u-boot/commitdiff
USB: gadget: atmel: disconnect before unbind
authorBo Shen <voice.shen@atmel.com>
Tue, 24 Sep 2013 05:19:24 +0000 (13:19 +0800)
committerMarek Vasut <marex@denx.de>
Tue, 24 Sep 2013 15:51:36 +0000 (17:51 +0200)
When unbind the gadget driver, need call disconnect first.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
drivers/usb/gadget/atmel_usba_udc.c

index f146c48afaa325291283500bebb3c319e826052b..c99208d10200d17a5729d2f16ce39c6be76bab1b 100644 (file)
@@ -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;