提交 b7a597d1 编写于 作者: J Jean-Francois Moine 提交者: Mauro Carvalho Chehab

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: NJean-Francois Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 6f081264
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册