aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc-core.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-04-27 11:02:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-12 09:32:22 -0700
commit804596fcfa2946ea83737346290f806651cd69ea (patch)
tree6372f5229c85c3bc2037c03d02efbc479971e2b7 /drivers/usb/gadget/udc-core.c
parentf3d426d5b791e91a0c515ac8f9dbf9e16dc439e6 (diff)
usb: gadget: udc-core: fix wrong call order
commit 83a787a71e034244a9fd1d5988fe18f226341417 upstream. commit 6d258a4 (usb: gadget: udc-core: stop UDC on device-initiated disconnect) introduced another case of asymmetric calls when issuing a device-initiated disconnect. Fix it. Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/udc-core.c')
-rw-r--r--drivers/usb/gadget/udc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index ec02ed0e66a..3ea783de96b 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -363,9 +363,9 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
usb_gadget_udc_start(udc->gadget, udc->driver);
usb_gadget_connect(udc->gadget);
} else if (sysfs_streq(buf, "disconnect")) {
+ usb_gadget_disconnect(udc->gadget);
if (udc_is_newstyle(udc))
usb_gadget_udc_stop(udc->gadget, udc->driver);
- usb_gadget_disconnect(udc->gadget);
} else {
dev_err(dev, "unsupported command '%s'\n", buf);
return -EINVAL;