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>
This commit is contained in:
Michał Mirosław 2020-05-28 20:30:28 +02:00 коммит произвёл Felipe Balbi
Родитель a1c0169a49
Коммит e7a0ed3fa3
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -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))