usb: chipidea: gadget: use udc-core's reset notifier
authorPeter Chen <peter.chen@freescale.com>
Thu, 6 Nov 2014 06:27:58 +0000 (14:27 +0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 10 Nov 2014 23:19:35 +0000 (17:19 -0600)
Replace usb_gadget_driver's disconnect with udc-core's reset notifier at
bus reset handler.

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

index a2d80ab3d9c49f6de66c2f4cc4d990b838dc06e4..bdaa7bac6f4a2dec68a350f7d2c47b47f6fe65c8 100644 (file)
@@ -692,10 +692,8 @@ __acquires(ci->lock)
        int retval;
 
        spin_unlock(&ci->lock);
-       if (ci->gadget.speed != USB_SPEED_UNKNOWN) {
-               if (ci->driver)
-                       ci->driver->disconnect(&ci->gadget);
-       }
+       if (ci->gadget.speed != USB_SPEED_UNKNOWN)
+               usb_gadget_udc_reset(&ci->gadget, ci->driver);
 
        retval = _gadget_stop_activity(&ci->gadget);
        if (retval)
@@ -709,8 +707,6 @@ __acquires(ci->lock)
        if (ci->status == NULL)
                retval = -ENOMEM;
 
-       usb_gadget_set_state(&ci->gadget, USB_STATE_DEFAULT);
-
 done:
        spin_lock(&ci->lock);