Skip to content

Commit

Permalink
V4L/DVB (13897): gspca - main: Check the interface class at probe time.
Browse files Browse the repository at this point in the history
The USB video interface was checked as having the number zero, but
some webcams have other values. The test is now done on the interface
class which may be either 255 (vendor spec) or 0 (class per interface).

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 38719d4 commit 52a9d3e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -2062,9 +2062,13 @@ int gspca_dev_probe(struct usb_interface *intf,
PDEBUG(D_ERR, "Too many config");
return -ENODEV;
}

/* check the interface class and ignore the sound interfaces */
interface = &intf->cur_altsetting->desc;
if (interface->bInterfaceNumber > 0) {
PDEBUG(D_ERR, "intf != 0");
if (interface->bInterfaceClass != USB_CLASS_VENDOR_SPEC
&& interface->bInterfaceClass != USB_CLASS_PER_INTERFACE) {
PDEBUG(D_PROBE, "Interface class %d not handled here",
interface->bInterfaceClass);
return -ENODEV;
}

Expand Down

0 comments on commit 52a9d3e

Please sign in to comment.