diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2009-04-15 16:27:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:41 -0400 |
commit | 71de6b63f15924e5aed2de0b975efc5117c0ca75 (patch) | |
tree | 3a410035235df80e15e60be3c57d48c464563ec8 /drivers/usb/gadget/atmel_usba_udc.c | |
parent | 15739bb5023ab9373e0c6c7c703dc8c50ead9eca (diff) |
USB: atmel_usba_udc: use helper functions to determine endpoint type and direction
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@kaehlcke.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/atmel_usba_udc.c')
-rw-r--r-- | 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 05c913cc3658..7a8f4421924c 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) | |||
550 | DBG(DBG_HW, "%s: EPT_SIZE = %lu (maxpacket = %lu)\n", | 550 | DBG(DBG_HW, "%s: EPT_SIZE = %lu (maxpacket = %lu)\n", |
551 | ep->ep.name, ept_cfg, maxpacket); | 551 | ep->ep.name, ept_cfg, maxpacket); |
552 | 552 | ||
553 | if ((desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) { | 553 | if (usb_endpoint_dir_in(desc)) { |
554 | ep->is_in = 1; | 554 | ep->is_in = 1; |
555 | ept_cfg |= USBA_EPT_DIR_IN; | 555 | ept_cfg |= USBA_EPT_DIR_IN; |
556 | } | 556 | } |
557 | 557 | ||
558 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 558 | switch (usb_endpoint_type(desc)) { |
559 | case USB_ENDPOINT_XFER_CONTROL: | 559 | case USB_ENDPOINT_XFER_CONTROL: |
560 | ept_cfg |= USBA_BF(EPT_TYPE, USBA_EPT_TYPE_CONTROL); | 560 | ept_cfg |= USBA_BF(EPT_TYPE, USBA_EPT_TYPE_CONTROL); |
561 | ept_cfg |= USBA_BF(BK_NUMBER, USBA_BK_NUMBER_ONE); | 561 | ept_cfg |= USBA_BF(BK_NUMBER, USBA_BK_NUMBER_ONE); |