]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (10789): m5602-s5k4aa: Split up the initial sensor probe in chunks.
authorGregory Lardiere <spmf2004-m560x@yahoo.fr>
Sun, 22 Feb 2009 20:54:11 +0000 (17:54 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 5 Mar 2009 23:33:37 +0000 (20:33 -0300)
The previous probe rotine tried to read 6 bytes in one chunk which currently isn't allowed. This is the rev. 10346 243399e67c41 readded with a high priority.

Signed-off-by: Gregory Lardiere <spmf2004-m560x@yahoo.fr>
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/m5602/m5602_s5k4aa.c

index e564a61a72d77b15db396d1cb1c9ba7f97a58335..48892b5715d5e7cc94014f0346688cc473e270f1 100644 (file)
@@ -102,7 +102,11 @@ int s5k4aa_probe(struct sd *sd)
        }
 
        /* Test some registers, but we don't know their exact meaning yet */
-       if (m5602_read_sensor(sd, 0x00, prod_id, sizeof(prod_id)))
+       if (m5602_read_sensor(sd, 0x00, prod_id, 2))
+               return -ENODEV;
+       if (m5602_read_sensor(sd, 0x02, prod_id+2, 2))
+               return -ENODEV;
+       if (m5602_read_sensor(sd, 0x04, prod_id+4, 2))
                return -ENODEV;
 
        if (memcmp(prod_id, expected_prod_id, sizeof(prod_id)))