]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00221445 ov5642: return error number when change camera mode
authorYuxi Sun <b36102@freescale.com>
Mon, 27 Aug 2012 01:58:30 +0000 (09:58 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:19 +0000 (08:35 +0200)
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 <b36102@freescale.com>
drivers/media/video/mxc/capture/ov5642.c

index 245a92c15ef131ae8d1ccb7b8c0fe23f13ff7542..492748c6cac4be46129d34ba808ef6b73be80583 100644 (file)
@@ -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 ;
 }