Skip to content

Commit

Permalink
V4L/DVB: mt9m111: init chip after read CHIP_VERSION
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Grzeschik authored and Mauro Carvalho Chehab committed Aug 9, 2010
1 parent c8cf078 commit 175bad9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/media/video/mt9m111.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -993,6 +989,8 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
goto ei2c;
}

ret = mt9m111_init(client);

ei2c:
return ret;
}
Expand Down

0 comments on commit 175bad9

Please sign in to comment.