include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / usb / gadget / ci13xxx_udc.c
index 38e531ecae4d310066e7813f2550420aa33e3ab3..699695128e33de185f743afa8f26ed51f38f9295 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
+#include <linux/slab.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 
@@ -1977,9 +1978,9 @@ static int ep_enable(struct usb_ep *ep,
        if (!list_empty(&mEp->qh[mEp->dir].queue))
                warn("enabling a non-empty endpoint!");
 
-       mEp->dir  = (desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ? TX : RX;
-       mEp->num  =  desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-       mEp->type =  desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
+       mEp->dir  = usb_endpoint_dir_in(desc) ? TX : RX;
+       mEp->num  = usb_endpoint_num(desc);
+       mEp->type = usb_endpoint_type(desc);
 
        mEp->ep.maxpacket = __constant_le16_to_cpu(desc->wMaxPacketSize);