Commit 0abd0696 authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarFelipe Balbi <balbi@ti.com>
parent 0b0231aa
...@@ -517,6 +517,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev, ...@@ -517,6 +517,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
usb_gadget_connect(udc->gadget); usb_gadget_connect(udc->gadget);
} else if (sysfs_streq(buf, "disconnect")) { } else if (sysfs_streq(buf, "disconnect")) {
usb_gadget_disconnect(udc->gadget); usb_gadget_disconnect(udc->gadget);
udc->driver->disconnect(udc->gadget);
usb_gadget_udc_stop(udc->gadget, udc->driver); usb_gadget_udc_stop(udc->gadget, udc->driver);
} else { } else {
dev_err(dev, "unsupported command '%s'\n", buf); dev_err(dev, "unsupported command '%s'\n", buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment