Skip to content

Commit

Permalink
USB: at91_udc: use helper functions to determine endpoint type and di…
Browse files Browse the repository at this point in the history
…rection

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>
  • Loading branch information
Matthias Kaehlcke authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 71de6b6 commit 81c8d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/at91_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
return -ESHUTDOWN;
}

tmp = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
tmp = usb_endpoint_type(desc);
switch (tmp) {
case USB_ENDPOINT_XFER_CONTROL:
DBG("only one control endpoint\n");
Expand Down Expand Up @@ -517,7 +517,7 @@ static int at91_ep_enable(struct usb_ep *_ep,
local_irq_save(flags);

/* 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->stopped = 0;
if (ep->is_in)
Expand Down

0 comments on commit 81c8d8d

Please sign in to comment.