]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00277805-2 usb: chipidea: udc: Consolidate the call of disconnect
authorPeter Chen <peter.chen@freescale.com>
Wed, 10 Jul 2013 09:21:23 +0000 (17:21 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 15:44:50 +0000 (17:44 +0200)
The udc-core will call gadget's driver->disconnect, so we should avoid
calling gadget's disconnect again at ci_udc_stop in case the gadget's
unbind free some structs which is still used at gadget's disconnect.

Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/udc.c

index 69425b3cb6b764009346601223ac76ace45a55b0..d5eb1ed17585bb5b5e7bfae098bfa3e1ab211201 100644 (file)
@@ -691,6 +691,11 @@ __acquires(ci->lock)
 {
        int retval;
 
+       if (ci->gadget.speed != USB_SPEED_UNKNOWN) {
+               if (ci->driver)
+                       ci->driver->disconnect(&ci->gadget);
+       }
+
        spin_unlock(&ci->lock);
        if (ci->gadget.speed != USB_SPEED_UNKNOWN) {
                if (ci->driver)