V4L/DVB (8361): gspca: Bad check of i2c write to sn9c10x.
authorAndoni Zubimendi <andoni.zubimendi@gmail.com>
Wed, 16 Jul 2008 11:40:30 +0000 (08:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:27:01 +0000 (07:27 -0300)
Signed-off-by: Andoni Zubimendi <andoni.zubimendi@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/gspca/sonixb.c

index 054ce4e3ece7f318c8e668872ab961816babf705..80879bf3188fff3284ccddc5045d1dc44cab752f 100644 (file)
@@ -456,8 +456,11 @@ static int i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer)
        while (retry--) {
                msleep(10);
                reg_r(gspca_dev, 0x08);
-               if (gspca_dev->usb_buf[0] == 4)
+               if (gspca_dev->usb_buf[0] & 0x04) {
+                       if (gspca_dev->usb_buf[0] & 0x08)
+                               return -1;
                        return 0;
+               }
        }
        return -1;
 }