V4L/DVB (13925): gspca - main: Change the check of the USB video interface.

Some webcams have many interfaces with the same interface class, so the
previous interface check did not work.
The new code checks if the interface number is zero or the only one.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jean-Francois Moine 2010-01-10 16:36:53 -03:00 committed by Mauro Carvalho Chehab
parent 6f081264f8
commit b7a597d110
1 changed files with 3 additions and 6 deletions

View File

@ -2063,14 +2063,11 @@ int gspca_dev_probe(struct usb_interface *intf,
return -ENODEV; return -ENODEV;
} }
/* check the interface class and ignore the sound interfaces */ /* the USB video interface must be the first one */
interface = &intf->cur_altsetting->desc; interface = &intf->cur_altsetting->desc;
if (interface->bInterfaceClass != USB_CLASS_VENDOR_SPEC if (dev->config->desc.bNumInterfaces != 1 &&
&& interface->bInterfaceClass != USB_CLASS_PER_INTERFACE) { interface->bInterfaceNumber != 0)
PDEBUG(D_PROBE, "Interface class %d not handled here",
interface->bInterfaceClass);
return -ENODEV; return -ENODEV;
}
/* create the device */ /* create the device */
if (dev_size < sizeof *gspca_dev) if (dev_size < sizeof *gspca_dev)