]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
V4L/DVB: mt9m111: init chip after read CHIP_VERSION
authorMichael Grzeschik <m.grzeschik@pengutronix.de>
Tue, 3 Aug 2010 10:57:40 +0000 (07:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Aug 2010 02:43:03 +0000 (23:43 -0300)
Moved mt9m111_init after the chip version detection passage: I
don't like the idea of writing on a device we haven't identified
yet.

Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/mt9m111.c

index 9f92d63532314c6db410750c3e66f802589e014b..758a4db27d65651481eec16b970f755a9036f622 100644 (file)
@@ -969,10 +969,6 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
        mt9m111->swap_rgb_even_odd = 1;
        mt9m111->swap_rgb_red_blue = 1;
 
-       ret = mt9m111_init(client);
-       if (ret)
-               goto ei2c;
-
        data = reg_read(CHIP_VERSION);
 
        switch (data) {
@@ -993,6 +989,8 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
                goto ei2c;
        }
 
+       ret = mt9m111_init(client);
+
 ei2c:
        return ret;
 }