summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorFelipe Balbi2014-09-29 20:35:54 +0200
committerFelipe Balbi2014-10-20 22:58:48 +0200
commit52ec49a5e56a27c5b6f8217708783eff39f24c16 (patch)
tree22e03456fbf8d7a1bc05ad5f30bb65d4fb7ff00b /drivers/usb/gadget
parentusb: gadget: function: uvc: return correct alt-setting (diff)
downloadkernel-qcow2-linux-52ec49a5e56a27c5b6f8217708783eff39f24c16.tar.gz
kernel-qcow2-linux-52ec49a5e56a27c5b6f8217708783eff39f24c16.tar.xz
kernel-qcow2-linux-52ec49a5e56a27c5b6f8217708783eff39f24c16.zip
usb: gadget: function: acm: make f_acm pass USB20CV Chapter9
During Halt Endpoint Test, our interrupt endpoint will be disabled, which will clear out ep->desc to NULL. Unless we call config_ep_by_speed() again, we will not be able to enable this endpoint which will make us fail that test. Fixes: f9c56cd (usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disable) Cc: <stable@vger.kernel.org> # v3.4+ Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/f_acm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
index 6da4685490ef..aad8165e98ef 100644
--- a/drivers/usb/gadget/function/f_acm.c
+++ b/drivers/usb/gadget/function/f_acm.c
@@ -433,12 +433,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
dev_vdbg(&cdev->gadget->dev,
"reset acm control interface %d\n", intf);
usb_ep_disable(acm->notify);
- } else {
- dev_vdbg(&cdev->gadget->dev,
- "init acm ctrl interface %d\n", intf);
+ }
+
+ if (!acm->notify->desc)
if (config_ep_by_speed(cdev->gadget, f, acm->notify))
return -EINVAL;
- }
+
usb_ep_enable(acm->notify);
acm->notify->driver_data = acm;