From 6ea6759be80adb419d96ad38ae43612d5d220b9f Mon Sep 17 00:00:00 2001 From: Yuxi Sun Date: Mon, 27 Aug 2012 09:58:30 +0800 Subject: [PATCH] ENGR00221445 ov5642: return error number when change camera mode return error number when set camera change mode fail, if not the driver may continue to setup the video processing with wrong parameter. Signed-off-by: Yuxi Sun --- drivers/media/video/mxc/capture/ov5642.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/mxc/capture/ov5642.c b/drivers/media/video/mxc/capture/ov5642.c index 245a92c15ef1..492748c6cac4 100644 --- a/drivers/media/video/mxc/capture/ov5642.c +++ b/drivers/media/video/mxc/capture/ov5642.c @@ -3228,6 +3228,7 @@ err: static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate, enum ov5642_mode mode) { + int ret = 0; bool m_60Hz = false; u16 capture_frame_rate = 50; u16 g_preview_frame_rate = 225; @@ -3255,7 +3256,10 @@ static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate, gain = 0; ov5642_read_reg(0x350b, &gain); - ov5642_init_mode(frame_rate, mode); + ret = ov5642_init_mode(frame_rate, mode); + if (ret < 0) + return ret; + ret_h = ret_m = ret_l = 0; ov5642_read_reg(0x380e, &ret_h); ov5642_read_reg(0x380f, &ret_l); @@ -3331,7 +3335,7 @@ static int ov5642_write_snapshot_para(enum ov5642_frame_rate frame_rate, ov5642_write_reg(0x3500, exposure_high); msleep(500); - return 0; + return ret ; } -- 2.39.5