diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-08-15 12:22:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-22 16:27:01 -0400 |
commit | 5611588b86492eded428cad0f698c39178f88d23 (patch) | |
tree | 5b8ccd9363fc152a388b7448091acef209809d1c /drivers | |
parent | 9408d8f0f86b9eaafc3c5a07f148f009a6abcfc6 (diff) |
[media] rc-core: use USB API functions rather than constants
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/rc/streamzap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 80c4feeb01ea..bf4a44272f0e 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
@@ -362,16 +362,14 @@ static int streamzap_probe(struct usb_interface *intf, | |||
362 | } | 362 | } |
363 | 363 | ||
364 | sz->endpoint = &(iface_host->endpoint[0].desc); | 364 | sz->endpoint = &(iface_host->endpoint[0].desc); |
365 | if ((sz->endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) | 365 | if (!usb_endpoint_dir_in(sz->endpoint)) { |
366 | != USB_DIR_IN) { | ||
367 | dev_err(&intf->dev, "%s: endpoint doesn't match input device " | 366 | dev_err(&intf->dev, "%s: endpoint doesn't match input device " |
368 | "02%02x\n", __func__, sz->endpoint->bEndpointAddress); | 367 | "02%02x\n", __func__, sz->endpoint->bEndpointAddress); |
369 | retval = -ENODEV; | 368 | retval = -ENODEV; |
370 | goto free_sz; | 369 | goto free_sz; |
371 | } | 370 | } |
372 | 371 | ||
373 | if ((sz->endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | 372 | if (!usb_endpoint_xfer_int(sz->endpoint)) { |
374 | != USB_ENDPOINT_XFER_INT) { | ||
375 | dev_err(&intf->dev, "%s: endpoint attributes don't match xfer " | 373 | dev_err(&intf->dev, "%s: endpoint attributes don't match xfer " |
376 | "02%02x\n", __func__, sz->endpoint->bmAttributes); | 374 | "02%02x\n", __func__, sz->endpoint->bmAttributes); |
377 | retval = -ENODEV; | 375 | retval = -ENODEV; |