Commit 1d243c2e authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: probe: simplify the endpoints tests

we are interested only in isochronous in endpoints
so we can simplify the flow

Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 49c30e57
...@@ -2988,7 +2988,7 @@ static int easycap_usb_probe(struct usb_interface *intf, ...@@ -2988,7 +2988,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
struct data_urb *pdata_urb; struct data_urb *pdata_urb;
size_t wMaxPacketSize; size_t wMaxPacketSize;
u8 bEndpointAddress; u8 bEndpointAddress;
int isin, i, j, k, m, rc; int i, j, k, m, rc;
u8 bInterfaceNumber; u8 bInterfaceNumber;
u8 bInterfaceClass; u8 bInterfaceClass;
u8 bInterfaceSubClass; u8 bInterfaceSubClass;
...@@ -3353,30 +3353,20 @@ static int easycap_usb_probe(struct usb_interface *intf, ...@@ -3353,30 +3353,20 @@ static int easycap_usb_probe(struct usb_interface *intf,
wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize); wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize);
bEndpointAddress = ep->bEndpointAddress; bEndpointAddress = ep->bEndpointAddress;
if (ep->bEndpointAddress & USB_DIR_IN) {
JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n", if (!usb_endpoint_is_isoc_in(ep)) {
bInterfaceNumber, i, j); JOM(4, "intf[%i]alt[%i]end[%i] is a %d endpoint\n",
isin = 1; bInterfaceNumber,
} else { i, j, ep->bmAttributes);
JOM(4, "intf[%i]alt[%i]end[%i] is an OUT endpoint\n", if (usb_endpoint_dir_out(ep)) {
bInterfaceNumber, i, j);
SAM("ERROR: OUT endpoint unexpected\n"); SAM("ERROR: OUT endpoint unexpected\n");
SAM("...... continuing\n"); SAM("...... continuing\n");
isin = 0;
} }
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == continue;
USB_ENDPOINT_XFER_ISOC) { }
JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n",
bInterfaceNumber, i, j);
if (isin) {
switch (bInterfaceClass) { switch (bInterfaceClass) {
case USB_CLASS_VIDEO: case USB_CLASS_VIDEO:
case USB_CLASS_VENDOR_SPEC: { case USB_CLASS_VENDOR_SPEC: {
if (!peasycap) {
SAM("MISTAKE: "
"peasycap is NULL\n");
return -EFAULT;
}
if (ep->wMaxPacketSize) { if (ep->wMaxPacketSize) {
if (8 > isokalt) { if (8 > isokalt) {
okalt[isokalt] = i; okalt[isokalt] = i;
...@@ -3488,21 +3478,6 @@ static int easycap_usb_probe(struct usb_interface *intf, ...@@ -3488,21 +3478,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
default: default:
break; break;
} }
}
} else if ((ep->bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK) {
JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n",
bInterfaceNumber, i, j);
} else if ((ep->bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_INT) {
JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n",
bInterfaceNumber, i, j);
} else {
JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n",
bInterfaceNumber, i, j);
}
if (0 == ep->wMaxPacketSize) { if (0 == ep->wMaxPacketSize) {
JOM(4, "intf[%i]alt[%i]end[%i] " JOM(4, "intf[%i]alt[%i]end[%i] "
"has zero packet size\n", "has zero packet size\n",
......
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