diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-06-24 03:57:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:51:45 -0400 |
commit | 7d716a36c349bad75e13352d11211c3ae556e92f (patch) | |
tree | 03d66e3e807198abe77940eefe3bf2d4f98c0454 /drivers | |
parent | a1317135d109f4b6dd89caa1a9b2b6c8d54b09cd (diff) |
V4L/DVB: gspca - sq930x: Check the USB read errors
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/gspca/sq930x.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index 7e4381bbaf28..dd24127d5168 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c | |||
@@ -356,12 +356,20 @@ static const struct cap_s { | |||
356 | static void reg_r(struct gspca_dev *gspca_dev, | 356 | static void reg_r(struct gspca_dev *gspca_dev, |
357 | u16 value, int len) | 357 | u16 value, int len) |
358 | { | 358 | { |
359 | usb_control_msg(gspca_dev->dev, | 359 | int ret; |
360 | |||
361 | if (gspca_dev->usb_err < 0) | ||
362 | return; | ||
363 | ret = usb_control_msg(gspca_dev->dev, | ||
360 | usb_rcvctrlpipe(gspca_dev->dev, 0), | 364 | usb_rcvctrlpipe(gspca_dev->dev, 0), |
361 | 0x0c, | 365 | 0x0c, |
362 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 366 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
363 | value, 0, gspca_dev->usb_buf, len, | 367 | value, 0, gspca_dev->usb_buf, len, |
364 | 500); | 368 | 500); |
369 | if (ret < 0) { | ||
370 | PDEBUG(D_ERR, "reg_r %04x failed %d", value, ret); | ||
371 | gspca_dev->usb_err = ret; | ||
372 | } | ||
365 | } | 373 | } |
366 | 374 | ||
367 | static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index) | 375 | static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index) |