summaryrefslogtreecommitdiff
path: root/drivers/media/video/mxc/capture/ov5642.c
diff options
context:
space:
mode:
authorSheng Nan <b38800@freescale.com>2012-10-17 14:55:10 +0800
committerSheng Nan <b38800@freescale.com>2012-10-17 15:06:22 +0800
commit2dd75f173f1253b50fc3eae97d6a9785e0f622f4 (patch)
treea93e0e812f494f8a7ca06122314b1b0c1c6831d0 /drivers/media/video/mxc/capture/ov5642.c
parentbff791a2345d5023c2a537b9bbfa86cd9a3b1bea (diff)
ENGR00229962 Capture: ov5642/ov5640: update sensor params even if s_parm failed
ioctl_s_parm for ov5642 and ov5640, it didn't check if sensor changed mode successfully. So it updates the sensor parameters with new framerate and new mode even if the sensor failed to change mode. The original framerate and mode is useful for the exposure calculation. It should keep consistent with sensor actual work mode. - This patch checks the return value of function which changes sensor mode If it succeed, update sensor parameters. Signed-off-by: Sheng Nan <b38800@freescale.com>
Diffstat (limited to 'drivers/media/video/mxc/capture/ov5642.c')
-rw-r--r--drivers/media/video/mxc/capture/ov5642.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/mxc/capture/ov5642.c b/drivers/media/video/mxc/capture/ov5642.c
index 534d8ad38a16..426438276908 100644
--- a/drivers/media/video/mxc/capture/ov5642.c
+++ b/drivers/media/video/mxc/capture/ov5642.c
@@ -3526,6 +3526,9 @@ static int ioctl_s_parm(struct v4l2_int_device *s, struct v4l2_streamparm *a)
ret = ov5642_change_mode(new_frame_rate, old_frame_rate,
a->parm.capture.capturemode,
sensor->streamcap.capturemode);
+ if (ret < 0)
+ return ret;
+
sensor->streamcap.timeperframe = *timeperframe;
sensor->streamcap.capturemode =
(u32)a->parm.capture.capturemode;