USB: legousbtower: Use usb_endpoint_* functions
authorLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Thu, 26 Oct 2006 16:02:54 +0000 (13:02 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:23:28 +0000 (14:23 -0800)
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/legousbtower.c

index 27089497e717975c0543d537aa22562061ac9d56..f8611997bd77595b43c507c7cff812a40c3ec635 100644 (file)
@@ -898,14 +898,11 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
        for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
                endpoint = &iface_desc->endpoint[i].desc;
 
-               if (((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) &&
-                   ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
-                       dev->interrupt_in_endpoint = endpoint;
-               }
-
-               if (((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) &&
-                   ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
-                       dev->interrupt_out_endpoint = endpoint;
+               if (usb_endpoint_xfer_int(endpoint)) {
+                       if (usb_endpoint_dir_in(endpoint))
+                               dev->interrupt_in_endpoint = endpoint;
+                       else
+                               dev->interrupt_out_endpoint = endpoint;
                }
        }
        if(dev->interrupt_in_endpoint == NULL) {