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>
        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) {
                goto ei2c;
        }
 
+       ret = mt9m111_init(client);
+
 ei2c:
        return ret;
 }