diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-01-01 15:20:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 06:04:17 -0500 |
commit | 5dae603d84ff5b6b24186b521f4353b3860b11e2 (patch) | |
tree | 6bd98d21a98c06742865d2ee59bcaefd00c12749 /drivers/media/video/gspca/gspca.c | |
parent | 1153f04dea315a95e14ef5376737f7fbe18282c3 (diff) |
[media] gspca: Check dev->actconfig rather than dev->config
Check dev->actconfig rather than dev->config when checking various
configuration things. dev->config points to the array of configs for the
device so dev->config->foo boils down to dev->config[0].foo and the first
config is not necessarily always the active config.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 4767f159b62a..338dae448787 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -2313,12 +2313,12 @@ int gspca_dev_probe2(struct usb_interface *intf, | |||
2313 | gspca_dev->iface = intf->cur_altsetting->desc.bInterfaceNumber; | 2313 | gspca_dev->iface = intf->cur_altsetting->desc.bInterfaceNumber; |
2314 | 2314 | ||
2315 | /* check if any audio device */ | 2315 | /* check if any audio device */ |
2316 | if (dev->config->desc.bNumInterfaces != 1) { | 2316 | if (dev->actconfig->desc.bNumInterfaces != 1) { |
2317 | int i; | 2317 | int i; |
2318 | struct usb_interface *intf2; | 2318 | struct usb_interface *intf2; |
2319 | 2319 | ||
2320 | for (i = 0; i < dev->config->desc.bNumInterfaces; i++) { | 2320 | for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { |
2321 | intf2 = dev->config->interface[i]; | 2321 | intf2 = dev->actconfig->interface[i]; |
2322 | if (intf2 != NULL | 2322 | if (intf2 != NULL |
2323 | && intf2->altsetting != NULL | 2323 | && intf2->altsetting != NULL |
2324 | && intf2->altsetting->desc.bInterfaceClass == | 2324 | && intf2->altsetting->desc.bInterfaceClass == |
@@ -2399,7 +2399,7 @@ int gspca_dev_probe(struct usb_interface *intf, | |||
2399 | } | 2399 | } |
2400 | 2400 | ||
2401 | /* the USB video interface must be the first one */ | 2401 | /* the USB video interface must be the first one */ |
2402 | if (dev->config->desc.bNumInterfaces != 1 | 2402 | if (dev->actconfig->desc.bNumInterfaces != 1 |
2403 | && intf->cur_altsetting->desc.bInterfaceNumber != 0) | 2403 | && intf->cur_altsetting->desc.bInterfaceNumber != 0) |
2404 | return -ENODEV; | 2404 | return -ENODEV; |
2405 | 2405 | ||