Staging: media: lirc: Use USB API functions rather than constants
Subsystems (2)
PATCH 1/1 Staging: media: lirc: Use USB API functions rather than constants
Introduce the use of the function usb_endpoint_type.
The Coccinelle semantic patch that makes these changes is as follows:
@@ struct usb_endpoint_descriptor *epd; @@
- (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
+ usb_endpoint_type(epd)
--- drivers/staging/media/lirc/lirc_sasem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_sasem.c +1 -1
@@ -702,7 +702,7 @@ static int sasem_probe(struct usb_interface *interface, ep = &iface_desc->endpoint [i].desc; ep_dir = ep->bEndpointAddress &USB_ENDPOINT_DIR_MASK ; - ep_type = ep->bmAttributes &USB_ENDPOINT_XFERTYPE_MASK ; + ep_type =usb_endpoint_type (ep); if (!ir_ep_found && ep_dir == USB_DIR_IN &&
Signature · 1 line
2.1.4
Greg KH
maintainerQuoted 19 lines · Shraddha Barke
Introduce the use of the function
usb_endpoint_type.The Coccinelle semantic patch that makes these changes is as follows:
@@ struct
usb_endpoint_descriptor*epd; @@- (
epd->bmAttributes& \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
+usb_endpoint_type(epd)Signed-off-by Shraddha Barke <[email protected]>--- drivers/staging/media/lirc/lirc_sasem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/lirc/lirc_sasem.c +0
-0
drivers/staging/media/lirc/lirc_sasem.c static int sasem_probe(struct usb_interface *interface, · line 708
Quoted 8 lines
drivers/staging/media/lirc/lirc_sasem.c +1
-1@@ -702,7 +702,7 @@ static int sasem_probe(struct usb_interface *interface, ep = &iface_desc->endpoint [i].desc; ep_dir = ep->bEndpointAddress &USB_ENDPOINT_DIR_MASK ; - ep_type = ep->bmAttributes &USB_ENDPOINT_XFERTYPE_MASK ; + ep_type =usb_endpoint_type (ep); if (!ir_ep_found && ep_dir == USB_DIR_IN &&
The ep_type and ep_dir variables can just go away and you can use the functions like usb_endpoint_is_int_in() for testing this type of thing. Please do that instead.
thanks,
greg k-h