[18/67] usb: gadget: udc-core: call ->disconnect() when soft disconnecting

Message ID 1413566234-13537-19-git-send-email-balbi@ti.com
State Accepted
Commit 0abd0696982534a5cf75e8129989fa3d4b734797
Headers show

Commit Message

Felipe Balbi Oct. 17, 2014, 5:16 p.m.
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 | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index f205465..ddc6f57 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -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);