summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2015-05-04 14:55:12 +0200
committerFelipe Balbi <balbi@ti.com>2015-07-29 09:59:19 -0500
commit5601250bb1b4e736cf487d332f2d8d8833a84209 (patch)
treeec10a1510b9940af32642de211578b5f39d21bc4 /drivers/usb/gadget/composite.c
parentccdf138fe3e243c70301fcb6a101e366b7daef07 (diff)
downloadtalos-obmc-linux-5601250bb1b4e736cf487d332f2d8d8833a84209.tar.gz
talos-obmc-linux-5601250bb1b4e736cf487d332f2d8d8833a84209.zip
usb: composite: fix usb_function_activate/deactivate functions
Using usb_gadget_disconnect to make gadget temporarily invisible to host doesn't provide desired result, because gadget is connected immediately after binding regardless to previous usb_gadget_disconnect() calls. For this reason we use usb_gadget_deactivate() instead of usb_gadget_disconnect() to make it working as expected. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 9ff3203b50e2..86d4e8fdf8d3 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -279,7 +279,7 @@ int usb_function_deactivate(struct usb_function *function)
spin_lock_irqsave(&cdev->lock, flags);
if (cdev->deactivations == 0)
- status = usb_gadget_disconnect(cdev->gadget);
+ status = usb_gadget_deactivate(cdev->gadget);
if (status == 0)
cdev->deactivations++;
@@ -311,7 +311,7 @@ int usb_function_activate(struct usb_function *function)
else {
cdev->deactivations--;
if (cdev->deactivations == 0)
- status = usb_gadget_connect(cdev->gadget);
+ status = usb_gadget_activate(cdev->gadget);
}
spin_unlock_irqrestore(&cdev->lock, flags);
OpenPOWER on IntegriCloud