Commit 15739bb5 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Greg Kroah-Hartman

USB: ci13xxx_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 a864e3aa
...@@ -1977,9 +1977,9 @@ static int ep_enable(struct usb_ep *ep, ...@@ -1977,9 +1977,9 @@ static int ep_enable(struct usb_ep *ep,
if (!list_empty(&mEp->qh[mEp->dir].queue)) if (!list_empty(&mEp->qh[mEp->dir].queue))
warn("enabling a non-empty endpoint!"); warn("enabling a non-empty endpoint!");
mEp->dir = (desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ? TX : RX; mEp->dir = usb_endpoint_dir_in(desc) ? TX : RX;
mEp->num = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; mEp->num = usb_endpoint_num(desc);
mEp->type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; mEp->type = usb_endpoint_type(desc);
mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize); mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize);
......
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