]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
V4L/DVB (13925): gspca - main: Change the check of the USB video interface.
authorJean-Francois Moine <moinejf@free.fr>
Sun, 10 Jan 2010 19:36:53 +0000 (16:36 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:32 +0000 (15:10 -0300)
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>
drivers/media/video/gspca/gspca.c

index 351cf8a658fc577e32203068dfaa3a0e1c116946..04aaa88ce4f579b20f7798da501da513cca8ec6e 100644 (file)
@@ -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)