aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mt9m001.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2008-08-14 11:03:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:50 -0400
commit112116410aaab5310a9a279c71fb76605236e448 (patch)
tree8184853dc7113f507cc0be3f698d4a9e466c85a1 /drivers/media/video/mt9m001.c
parent77110abbfbfd7673be6d18ef0875350eabee7532 (diff)
V4L/DVB (8685): mt9m001, mt9v022: Simplify return code checking
i2c_smbus_write_word_data() returns 0 or a negative error, hence no need to check for "> 0". Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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,