Re: [PATCH 01/10] atmel_usba_udc: use helper functions to determine endpoint type and direction

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

 



On Wednesday 15 April 2009, Matthias Kaehlcke wrote:
> Use helper functions to determine the type and direction of an endpoint
> instead of fiddling with bEndpointAddress and bmAttributes
> 
> Signed-off-by: Matthias Kaehlcke <matthias@xxxxxxxxxxxx>

Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>


> ---
>  drivers/usb/gadget/atmel_usba_udc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
> index 563d572..a2cd4d8 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -550,12 +550,12 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
>  	DBG(DBG_HW, "%s: EPT_SIZE = %lu (maxpacket = %lu)\n",
>  			ep->ep.name, ept_cfg, maxpacket);
>  
> -	if ((desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {
> +	if (usb_endpoint_dir_in(desc)) {
>  		ep->is_in = 1;
>  		ept_cfg |= USBA_EPT_DIR_IN;
>  	}
>  
> -	switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
> +	switch (usb_endpoint_type(desc)) {
>  	case USB_ENDPOINT_XFER_CONTROL:
>  		ept_cfg |= USBA_BF(EPT_TYPE, USBA_EPT_TYPE_CONTROL);
>  		ept_cfg |= USBA_BF(BK_NUMBER, USBA_BK_NUMBER_ONE);
> -- 
> 1.6.2.1
> 
> 


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