summaryrefslogtreecommitdiff
path: root/drivers/staging/emxx_udc/emxx_udc.c
diff options
context:
space:
mode:
authorTapasweni Pathak <tapaswenipathak@gmail.com>2014-10-30 16:33:36 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-30 20:20:42 (GMT)
commit3f3efca9c57fd5c12ac8d9e151db5bbbaec2d716 (patch)
tree644681a1cf4e00e785ddeb3701f75ee671f1f7c9 /drivers/staging/emxx_udc/emxx_udc.c
parent3cfab18ce55282a85e2c7e5db15c5daf065efdb4 (diff)
downloadlinux-3f3efca9c57fd5c12ac8d9e151db5bbbaec2d716.tar.xz
staging: emxx_udc: use USB API functions rather than constants
This patch introduces the use of the functions usb_endpoint_type and usb_endpoint_num. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ - (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\)) + usb_endpoint_num(epd) @@ struct usb_endpoint_descriptor *epd; @@ - (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) + usb_endpoint_type(epd) Build Tested it. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/emxx_udc/emxx_udc.c')
-rw-r--r--drivers/staging/emxx_udc/emxx_udc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 77e4aee..0261d0b 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2622,7 +2622,7 @@ static int nbu2ss_ep_enable(
return -EINVAL;
}
- ep_type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
+ ep_type = usb_endpoint_type(desc);
if ((ep_type == USB_ENDPOINT_XFER_CONTROL)
|| (ep_type == USB_ENDPOINT_XFER_ISOC)) {
@@ -2644,7 +2644,7 @@ static int nbu2ss_ep_enable(
spin_lock_irqsave(&udc->lock, flags);
ep->desc = desc;
- ep->epnum = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+ ep->epnum = usb_endpoint_num(desc);
ep->direct = desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
ep->ep_type = ep_type;
ep->wedged = 0;