Skip to contentSkip to conversation

Staging: media: lirc: Use USB API functions rather than constants

PATCH New Shraddha Barke 1 participant 1 message Sep 29, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Staging: media: lirc: Use USB API functions rather than constants

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.

---
Changes in v2-
Used usb_endpoint_is_int_in() and removed ep_dir and ep_type. Also updated commit message.

 drivers/staging/media/lirc/lirc_sasem.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/staging/media/lirc/lirc_sasem.c +2 -8
index b247649a..d3dedb8 100644
@@ -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;
Signature · 1 line
2.1.4