Commit 5611588b authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Mauro Carvalho Chehab

[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: default avatarHimangi Saraogi <himangi774@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9408d8f0
...@@ -362,16 +362,14 @@ static int streamzap_probe(struct usb_interface *intf, ...@@ -362,16 +362,14 @@ static int streamzap_probe(struct usb_interface *intf,
} }
sz->endpoint = &(iface_host->endpoint[0].desc); sz->endpoint = &(iface_host->endpoint[0].desc);
if ((sz->endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) if (!usb_endpoint_dir_in(sz->endpoint)) {
!= USB_DIR_IN) {
dev_err(&intf->dev, "%s: endpoint doesn't match input device " dev_err(&intf->dev, "%s: endpoint doesn't match input device "
"02%02x\n", __func__, sz->endpoint->bEndpointAddress); "02%02x\n", __func__, sz->endpoint->bEndpointAddress);
retval = -ENODEV; retval = -ENODEV;
goto free_sz; goto free_sz;
} }
if ((sz->endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) if (!usb_endpoint_xfer_int(sz->endpoint)) {
!= USB_ENDPOINT_XFER_INT) {
dev_err(&intf->dev, "%s: endpoint attributes don't match xfer " dev_err(&intf->dev, "%s: endpoint attributes don't match xfer "
"02%02x\n", __func__, sz->endpoint->bmAttributes); "02%02x\n", __func__, sz->endpoint->bmAttributes);
retval = -ENODEV; retval = -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment