usb: musb: gadget: use udc-core's reset notifier
authorFelipe Balbi <balbi@ti.com>
Thu, 6 Nov 2014 06:27:54 +0000 (14:27 +0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 10 Nov 2014 23:19:34 +0000 (17:19 -0600)
Replace usb_gadget_driver's disconnect with udc-core's reset notifier at
bus reset handler.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_gadget.c

index 56c31b769a54f672d64bccfcc155c0a95b66d407..49b04cb6f5ca6acef7748f2945f1e0cd3230590c 100644 (file)
@@ -2083,9 +2083,12 @@ __acquires(musb->lock)
                                : NULL
                        );
 
-       /* report disconnect, if we didn't already (flushing EP state) */
-       if (musb->g.speed != USB_SPEED_UNKNOWN)
-               musb_g_disconnect(musb);
+       /* report reset, if we didn't already (flushing EP state) */
+       if (musb->gadget_driver && musb->g.speed != USB_SPEED_UNKNOWN) {
+               spin_unlock(&musb->lock);
+               usb_gadget_udc_reset(&musb->g, musb->gadget_driver);
+               spin_lock(&musb->lock);
+       }
 
        /* clear HR */
        else if (devctl & MUSB_DEVCTL_HR)