Re: [PATCH] usb: gadget: f_acm: don't disable disabled EP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 20-05-28 20:30:28, Michał Mirosław wrote:
> Make debugging real problems easier by not trying to disable an EP that
> was not yet enabled.
> 
> Fixes: 4aab757ca44a ("usb: gadget: f_acm: eliminate abuse of ep->driver data")
> Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
> ---
>  drivers/usb/gadget/function/f_acm.c | 8 +++++---
>  1 file 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);
> +		}

But it does not fix any issues, the usb_ep_disable checks 'enabled' flag.

-- 

Thanks,
Peter Chen




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux