usb: gadget: udc-core: call ->disconnect() when soft disconnecting
authorFelipe Balbi <balbi@ti.com>
Thu, 9 Oct 2014 15:12:24 +0000 (10:12 -0500)
committerFelipe Balbi <balbi@ti.com>
Mon, 3 Nov 2014 16:00:58 +0000 (10:00 -0600)
when disconnecting from host using our soft_connect
sysfs interface, also let the gadget driver know about
it by calling the gadget driver's ->disconnect()
method.

No problems have been found while not calling ->disconnect()
so far, it's just good convention.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/udc-core.c

index f2054659f25b8e6701bd634f902de1e6a76c6fe1..ddc6f577adb17f2ac041b7b6eae60d707be9c88b 100644 (file)
@@ -517,6 +517,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
                usb_gadget_connect(udc->gadget);
        } else if (sysfs_streq(buf, "disconnect")) {
                usb_gadget_disconnect(udc->gadget);
+               udc->driver->disconnect(udc->gadget);
                usb_gadget_udc_stop(udc->gadget, udc->driver);
        } else {
                dev_err(dev, "unsupported command '%s'\n", buf);