aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9m001.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mt9m001.c')
-rw-r--r--drivers/media/video/mt9m001.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/video/mt9m001.c b/drivers/media/video/mt9m001.c
index 554d2295484e..3531f9352dff 100644
--- a/drivers/media/video/mt9m001.c
+++ b/drivers/media/video/mt9m001.c
@@ -119,16 +119,16 @@ static int mt9m001_init(struct soc_camera_device *icd)
119{ 119{
120 int ret; 120 int ret;
121 121
122 /* Disable chip, synchronous option update */
123 dev_dbg(icd->vdev->parent, "%s\n", __func__); 122 dev_dbg(icd->vdev->parent, "%s\n", __func__);
124 123
125 ret = reg_write(icd, MT9M001_RESET, 1); 124 ret = reg_write(icd, MT9M001_RESET, 1);
126 if (ret >= 0) 125 if (!ret)
127 ret = reg_write(icd, MT9M001_RESET, 0); 126 ret = reg_write(icd, MT9M001_RESET, 0);
128 if (ret >= 0) 127 /* Disable chip, synchronous option update */
128 if (!ret)
129 ret = reg_write(icd, MT9M001_OUTPUT_CONTROL, 0); 129 ret = reg_write(icd, MT9M001_OUTPUT_CONTROL, 0);
130 130
131 return ret >= 0 ? 0 : -EIO; 131 return ret;
132} 132}
133 133
134static int mt9m001_release(struct soc_camera_device *icd) 134static int mt9m001_release(struct soc_camera_device *icd)
@@ -267,24 +267,24 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd,
267 267
268 /* Blanking and start values - default... */ 268 /* Blanking and start values - default... */
269 ret = reg_write(icd, MT9M001_HORIZONTAL_BLANKING, hblank); 269 ret = reg_write(icd, MT9M001_HORIZONTAL_BLANKING, hblank);
270 if (ret >= 0) 270 if (!ret)
271 ret = reg_write(icd, MT9M001_VERTICAL_BLANKING, vblank); 271 ret = reg_write(icd, MT9M001_VERTICAL_BLANKING, vblank);
272 272
273 /* The caller provides a supported format, as verified per 273 /* The caller provides a supported format, as verified per
274 * call to icd->try_fmt_cap() */ 274 * call to icd->try_fmt_cap() */
275 if (ret >= 0) 275 if (!ret)
276 ret = reg_write(icd, MT9M001_COLUMN_START, rect->left); 276 ret = reg_write(icd, MT9M001_COLUMN_START, rect->left);
277 if (ret >= 0) 277 if (!ret)
278 ret = reg_write(icd, MT9M001_ROW_START, rect->top); 278 ret = reg_write(icd, MT9M001_ROW_START, rect->top);
279 if (ret >= 0) 279 if (!ret)
280 ret = reg_write(icd, MT9M001_WINDOW_WIDTH, rect->width - 1); 280 ret = reg_write(icd, MT9M001_WINDOW_WIDTH, rect->width - 1);
281 if (ret >= 0) 281 if (!ret)
282 ret = reg_write(icd, MT9M001_WINDOW_HEIGHT, 282 ret = reg_write(icd, MT9M001_WINDOW_HEIGHT,
283 rect->height + icd->y_skip_top - 1); 283 rect->height + icd->y_skip_top - 1);
284 if (ret >= 0 && mt9m001->autoexposure) { 284 if (!ret && mt9m001->autoexposure) {
285 ret = reg_write(icd, MT9M001_SHUTTER_WIDTH, 285 ret = reg_write(icd, MT9M001_SHUTTER_WIDTH,
286 rect->height + icd->y_skip_top + vblank); 286 rect->height + icd->y_skip_top + vblank);
287 if (ret >= 0) { 287 if (!ret) {
288 const struct v4l2_queryctrl *qctrl = 288 const struct v4l2_queryctrl *qctrl =
289 soc_camera_find_qctrl(icd->ops, 289 soc_camera_find_qctrl(icd->ops,
290 V4L2_CID_EXPOSURE); 290 V4L2_CID_EXPOSURE);
@@ -295,7 +295,7 @@ static int mt9m001_set_fmt_cap(struct soc_camera_device *icd,
295 } 295 }
296 } 296 }
297 297
298 return ret < 0 ? ret : 0; 298 return ret;
299} 299}
300 300
301static int mt9m001_try_fmt_cap(struct soc_camera_device *icd, 301static int mt9m001_try_fmt_cap(struct soc_camera_device *icd,