Re: [PATCH] usb: gadget: at91_udc: fix build warning

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

 



Hi,

It does not solve the problem. When I wrote my patch (usb: gadget: add
"maxpacket_limit" field to struct usb_ep) I didn't noticed that original
code sets maxpacket values to field of struct at91_ep, not struct
usb_ep. Function usb_ep_set_maxpacket_limit() should not be used in this
place. Initialization of maxpacket field of struct at91_ep instances in
this place is necessary.

Reverting changes in at91udc_probe() function will be best solution,
because usb_ep_set_maxpacket_limit() function is called in udc_reinit(),
and this in enough to initialize maxpacket_limit properly.

I will prepare patch fixing this.

Best regards
Robert Baldyga
Samsung R&D Institute Poland


On 12/24/2013 02:30 AM, Felipe Balbi wrote:
> commit e117e742 (usb: gadget: add "maxpacket_limit"
> field to struct usb_ep) added a build warning to
> at91_udc when it passed the wrong argument to
> usb_ep_set_maxpacket_limit().
> 
> Fix this by passing correct argument.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---
>  drivers/usb/gadget/at91_udc.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
> index 0353b64..c3f49fd 100644
> --- a/drivers/usb/gadget/at91_udc.c
> +++ b/drivers/usb/gadget/at91_udc.c
> @@ -1759,15 +1759,15 @@ static int at91udc_probe(struct platform_device *pdev)
>  
>  	/* newer chips have more FIFO memory than rm9200 */
>  	if (cpu_is_at91sam9260() || cpu_is_at91sam9g20()) {
> -		usb_ep_set_maxpacket_limit(&udc->ep[0], 64);
> -		usb_ep_set_maxpacket_limit(&udc->ep[3], 64);
> -		usb_ep_set_maxpacket_limit(&udc->ep[4], 512);
> -		usb_ep_set_maxpacket_limit(&udc->ep[5], 512);
> +		usb_ep_set_maxpacket_limit(&udc->ep[0].ep, 64);
> +		usb_ep_set_maxpacket_limit(&udc->ep[3].ep, 64);
> +		usb_ep_set_maxpacket_limit(&udc->ep[4].ep, 512);
> +		usb_ep_set_maxpacket_limit(&udc->ep[5].ep, 512);
>  	} else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) {
> -		usb_ep_set_maxpacket_limit(&udc->ep[3], 64);
> +		usb_ep_set_maxpacket_limit(&udc->ep[3].ep, 64);
>  	} else if (cpu_is_at91sam9263()) {
> -		usb_ep_set_maxpacket_limit(&udc->ep[0], 64);
> -		usb_ep_set_maxpacket_limit(&udc->ep[3], 64);
> +		usb_ep_set_maxpacket_limit(&udc->ep[0].ep, 64);
> +		usb_ep_set_maxpacket_limit(&udc->ep[3].ep, 64);
>  	}
>  
>  	udc->udp_baseaddr = ioremap(res->start, resource_size(res));
> 

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