aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2010-01-10 16:36:53 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 15:10:32 -0300
commitb7a597d11073c4c3db79743d38cc942d324b2233 (patch)
tree247f4a4399968c00e3cd9e35dace05a08cf02d9c /drivers/media
parent6f081264f835467a3b69edc71753dac9d3ff770a (diff)
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/gspca.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 351cf8a658f..04aaa88ce4f 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -2063,14 +2063,11 @@ int gspca_dev_probe(struct usb_interface *intf,
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;
- if (interface->bInterfaceClass != USB_CLASS_VENDOR_SPEC
- && interface->bInterfaceClass != USB_CLASS_PER_INTERFACE) {
- PDEBUG(D_PROBE, "Interface class %d not handled here",
- interface->bInterfaceClass);
+ if (dev->config->desc.bNumInterfaces != 1 &&
+ interface->bInterfaceNumber != 0)
return -ENODEV;
- }
/* create the device */
if (dev_size < sizeof *gspca_dev)