diff options
| author | Hugues Fruchet <hugues.fruchet@st.com> | 2018-01-22 05:06:40 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-01-23 08:10:31 -0500 |
| commit | 6146fde355b4eef760102a8ce0d063c6ecf53cb8 (patch) | |
| tree | b0d21dfeeef0aae955409762e1defec0524d76c3 | |
| parent | 401f69308fe344b4353fad5233d99c7efa9deef5 (diff) | |
media: ov5640: fix spurious streamon failures
Time to time, stream on is failing with a strange positive error.
Error code is returned erroneously by ov5640_set_ctrl_exposure()
due to ov5640_get_vts() return value wrongly treated as error.
Fix this by forcing ret to 0 after ov5640_get_vts() success call,
in order that ret is set to success for rest of code sequence.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
| -rw-r--r-- | drivers/media/i2c/ov5640.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index f0177421b752..e2dd352224c7 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c | |||
| @@ -2057,6 +2057,7 @@ static int ov5640_set_ctrl_exposure(struct ov5640_dev *sensor, int exp) | |||
| 2057 | if (ret < 0) | 2057 | if (ret < 0) |
| 2058 | return ret; | 2058 | return ret; |
| 2059 | max_exp += ret; | 2059 | max_exp += ret; |
| 2060 | ret = 0; | ||
| 2060 | 2061 | ||
| 2061 | if (ctrls->exposure->val < max_exp) | 2062 | if (ctrls->exposure->val < max_exp) |
| 2062 | ret = ov5640_set_exposure(sensor, ctrls->exposure->val); | 2063 | ret = ov5640_set_exposure(sensor, ctrls->exposure->val); |
