diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2020-05-28 20:30:28 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 08:43:36 +0200 |
commit | e7a0ed3fa31be13a4bf5f81426cb4db560e031ee (patch) | |
tree | 672b5187419a6d8b90a1224b276eab9a7abe17b9 | |
parent | usb: gadget: aspeed: fixup vhub port irq handling (diff) | |
download | linux-e7a0ed3fa31be13a4bf5f81426cb4db560e031ee.tar.xz linux-e7a0ed3fa31be13a4bf5f81426cb4db560e031ee.zip |
usb: gadget: f_acm: don't disable disabled EP
Make debugging real problems easier by not trying to disable an EP that
was not yet enabled.
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
-rw-r--r-- | drivers/usb/gadget/function/f_acm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 200596ea9557..46647bfac2ef 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -425,9 +425,11 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) /* we know alt == 0, so this is an activation or a reset */ if (intf == acm->ctrl_id) { - dev_vdbg(&cdev->gadget->dev, - "reset acm control interface %d\n", intf); - usb_ep_disable(acm->notify); + if (acm->notify->enabled) { + dev_vdbg(&cdev->gadget->dev, + "reset acm control interface %d\n", intf); + usb_ep_disable(acm->notify); + } if (!acm->notify->desc) if (config_ep_by_speed(cdev->gadget, f, acm->notify)) |