summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-10-09 10:12:24 -0500
committerFelipe Balbi <balbi@ti.com>2014-11-03 10:00:58 -0600
commit0abd0696982534a5cf75e8129989fa3d4b734797 (patch)
treeaa20f857f8f489ce33adbde322f27321a6cc4375
parent0b0231aa246cbfdcf0a07f5e8914c0f1b80002f6 (diff)
usb: gadget: udc-core: call ->disconnect() when soft disconnecting
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>
-rw-r--r--drivers/usb/gadget/udc/udc-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index f2054659f25b..ddc6f577adb1 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);