From: Yuxi Sun Date: Mon, 27 Aug 2012 01:58:30 +0000 (+0800) Subject: ENGR00221445 ov5642: return error number when change camera mode X-Git-Tag: v3.0.35-fsl~539 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6ea6759be80adb419d96ad38ae43612d5d220b9f;p=karo-tx-linux.git 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 --- 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 ; }