diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2009-04-15 16:28:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:42 -0400 |
commit | 9ab1565151dff37a7d7687bfe5cfafb62c7d5e49 (patch) | |
tree | e89144306ad84ea93128522665994d93355f364a /drivers | |
parent | 81c8d8d28d6f2750acd4e41de34aefeb9404431c (diff) |
USB: Goku-S: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index de010c939db..112bb40a427 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -110,10 +110,10 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) | 111 | if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) |
112 | return -ESHUTDOWN; | 112 | return -ESHUTDOWN; |
113 | if (ep->num != (desc->bEndpointAddress & 0x0f)) | 113 | if (ep->num != usb_endpoint_num(desc)) |
114 | return -EINVAL; | 114 | return -EINVAL; |
115 | 115 | ||
116 | switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { | 116 | switch (usb_endpoint_type(desc)) { |
117 | case USB_ENDPOINT_XFER_BULK: | 117 | case USB_ENDPOINT_XFER_BULK: |
118 | case USB_ENDPOINT_XFER_INT: | 118 | case USB_ENDPOINT_XFER_INT: |
119 | break; | 119 | break; |
@@ -142,7 +142,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
142 | /* ep1/ep2 dma direction is chosen early; it works in the other | 142 | /* ep1/ep2 dma direction is chosen early; it works in the other |
143 | * direction, with pio. be cautious with out-dma. | 143 | * direction, with pio. be cautious with out-dma. |
144 | */ | 144 | */ |
145 | ep->is_in = (USB_DIR_IN & desc->bEndpointAddress) != 0; | 145 | ep->is_in = usb_endpoint_dir_in(desc); |
146 | if (ep->is_in) { | 146 | if (ep->is_in) { |
147 | mode |= 1; | 147 | mode |= 1; |
148 | ep->dma = (use_dma != 0) && (ep->num == UDC_MSTRD_ENDPOINT); | 148 | ep->dma = (use_dma != 0) && (ep->num == UDC_MSTRD_ENDPOINT); |