diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-06-24 04:57:12 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:51:45 -0300 |
commit | 7d716a36c349bad75e13352d11211c3ae556e92f (patch) | |
tree | 03d66e3e807198abe77940eefe3bf2d4f98c0454 /drivers/media/video/gspca/sq930x.c | |
parent | a1317135d109f4b6dd89caa1a9b2b6c8d54b09cd (diff) | |
download | blackbird-op-linux-7d716a36c349bad75e13352d11211c3ae556e92f.tar.gz blackbird-op-linux-7d716a36c349bad75e13352d11211c3ae556e92f.zip |
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/media/video/gspca/sq930x.c')
-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 { static void reg_r(struct gspca_dev *gspca_dev, u16 value, int len) { - usb_control_msg(gspca_dev->dev, + int ret; + + if (gspca_dev->usb_err < 0) + return; + ret = usb_control_msg(gspca_dev->dev, usb_rcvctrlpipe(gspca_dev->dev, 0), 0x0c, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, 0, gspca_dev->usb_buf, len, 500); + if (ret < 0) { + PDEBUG(D_ERR, "reg_r %04x failed %d", value, ret); + gspca_dev->usb_err = ret; + } } static void reg_w(struct gspca_dev *gspca_dev, u16 value, u16 index) |