Staging: media: lirc: Use USB API functions rather than constants
authorShraddha Barke <shraddha.6596@gmail.com>
Tue, 29 Sep 2015 19:21:28 +0000 (00:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Sep 2015 02:02:58 +0000 (04:02 +0200)
Introduce use of function usb_endpoint_is_int_in() and
usb_endpoint_is_int_out(). Also remove the variables
ep_dir and ep_type as they are not used anymore.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/lirc/lirc_sasem.c

index b247649a99eb46fcd9b491eaced8dde8da2ebcc4..d3dedb831dee761f09c8f66c2a6317efc47a26af 100644 (file)
@@ -697,16 +697,11 @@ static int sasem_probe(struct usb_interface *interface,
        for (i = 0; i < num_endpoints && !(ir_ep_found && vfd_ep_found); ++i) {
 
                struct usb_endpoint_descriptor *ep;
-               int ep_dir;
-               int ep_type;
 
                ep = &iface_desc->endpoint [i].desc;
-               ep_dir = ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
-               ep_type = ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
 
                if (!ir_ep_found &&
-                       ep_dir == USB_DIR_IN &&
-                       ep_type == USB_ENDPOINT_XFER_INT) {
+                       usb_endpoint_is_int_in(ep)) {
 
                        rx_endpoint = ep;
                        ir_ep_found = 1;
@@ -715,8 +710,7 @@ static int sasem_probe(struct usb_interface *interface,
                                        "%s: found IR endpoint\n", __func__);
 
                } else if (!vfd_ep_found &&
-                       ep_dir == USB_DIR_OUT &&
-                       ep_type == USB_ENDPOINT_XFER_INT) {
+                       usb_endpoint_is_int_out(ep)) {
 
                        tx_endpoint = ep;
                        vfd_ep_found = 1;
This page took 0.02549 seconds and 5 git commands to generate.