RE: [PATCH 2/2] usb/at91udc: Don't check for ep->ep.desc

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

 




> -----Original Message-----
> From: Sebastian Andrzej Siewior [mailto:bigeasy@xxxxxxxxxxxxx]
> Sent: quinta-feira, 19 de Julho de 2012 18:11
> To: Felipe Balbi
> Cc: Greg Kroah-Hartman; linux-usb@xxxxxxxxxxxxxxx; Mario Jorge
Isidoro; Fabio
> Porcedda; sebastian@xxxxxxxxxxxxx; Sebastian Andrzej Siewior; Ido
Shayevitz
> Subject: [PATCH 2/2] usb/at91udc: Don't check for ep->ep.desc
> 
> We used earlier to check for ep->ep.desc to figure out if this ep is
> already enabled and if so, abort.
> Ido Shayevitz removed the usb_endpoint_descriptor from private udc
> structure 5a6506f00 ("usb: gadget: Update at91_udc to use
> usb_endpoint_descriptor	inside the struct usb_ep") but did not
fix up
> the ep_enable condition because _now_ the member is always true and we
> can't check if this ep is enabled twice.
> 
> Cc: Ido Shayevitz <idos@xxxxxxxxxxxxxx>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/usb/gadget/at91_udc.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/at91_udc.c
b/drivers/usb/gadget/at91_udc.c
> index 5fd61e2..22865dd 100644
> --- a/drivers/usb/gadget/at91_udc.c
> +++ b/drivers/usb/gadget/at91_udc.c
> @@ -475,8 +475,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
>  	unsigned long	flags;
> 
>  	if (!_ep || !ep
> -			|| !desc || ep->ep.desc
> -			|| _ep->name == ep0name
> +			|| !desc || _ep->name == ep0name
>  			|| desc->bDescriptorType != USB_DT_ENDPOINT
>  			|| (maxpacket = usb_endpoint_maxp(desc)) == 0
>  			|| maxpacket > ep->maxpacket) {
> @@ -530,7 +529,6 @@ ok:
>  	tmp |= AT91_UDP_EPEDS;
>  	__raw_writel(tmp, ep->creg);
> 
> -	ep->ep.desc = desc;
>  	ep->ep.maxpacket = maxpacket;
> 
>  	/*
> --
> 1.7.10.4

Hi,

I've tested it, and it works fine here.

Tested-by: Mario Isidoro <Mario.Isidoro@xxxxxxxxx>

Best regards,
Mario Isidoro
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux