Skip to content

Commit

Permalink
[media] rc-core: use USB API functions rather than constants
Browse files Browse the repository at this point in the history
This patch introduces the use of !usb_endpoint_dir_in(epd) and
!usb_endpoint_xfer_int(epd).

The Coccinelle semantic patch that makes these changes is as follows:

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) !=
-  \(USB_DIR_IN\|0x80\))
+ !usb_endpoint_dir_in(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) !=
- \(USB_ENDPOINT_XFER_INT\|3\))
+ !usb_endpoint_xfer_int(epd)

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Himangi Saraogi authored and Mauro Carvalho Chehab committed Sep 22, 2014
1 parent 9408d8f commit 5611588
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/media/rc/streamzap.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,14 @@ static int streamzap_probe(struct usb_interface *intf,
}

sz->endpoint = &(iface_host->endpoint[0].desc);
if ((sz->endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
!= USB_DIR_IN) {
if (!usb_endpoint_dir_in(sz->endpoint)) {
dev_err(&intf->dev, "%s: endpoint doesn't match input device "
"02%02x\n", __func__, sz->endpoint->bEndpointAddress);
retval = -ENODEV;
goto free_sz;
}

if ((sz->endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
!= USB_ENDPOINT_XFER_INT) {
if (!usb_endpoint_xfer_int(sz->endpoint)) {
dev_err(&intf->dev, "%s: endpoint attributes don't match xfer "
"02%02x\n", __func__, sz->endpoint->bmAttributes);
retval = -ENODEV;
Expand Down

0 comments on commit 5611588

Please sign in to comment.