Commit 81c8d8d2 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Greg Kroah-Hartman

USB: at91_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: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 71de6b63
...@@ -485,7 +485,7 @@ static int at91_ep_enable(struct usb_ep *_ep, ...@@ -485,7 +485,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
return -ESHUTDOWN; return -ESHUTDOWN;
} }
tmp = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; tmp = usb_endpoint_type(desc);
switch (tmp) { switch (tmp) {
case USB_ENDPOINT_XFER_CONTROL: case USB_ENDPOINT_XFER_CONTROL:
DBG("only one control endpoint\n"); DBG("only one control endpoint\n");
...@@ -517,7 +517,7 @@ static int at91_ep_enable(struct usb_ep *_ep, ...@@ -517,7 +517,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
local_irq_save(flags); local_irq_save(flags);
/* initialize endpoint to match this descriptor */ /* initialize endpoint to match this descriptor */
ep->is_in = (desc->bEndpointAddress & USB_DIR_IN) != 0; ep->is_in = usb_endpoint_dir_in(desc);
ep->is_iso = (tmp == USB_ENDPOINT_XFER_ISOC); ep->is_iso = (tmp == USB_ENDPOINT_XFER_ISOC);
ep->stopped = 0; ep->stopped = 0;
if (ep->is_in) if (ep->is_in)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment