diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-08-14 11:03:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:50 -0400 |
commit | 112116410aaab5310a9a279c71fb76605236e448 (patch) | |
tree | 8184853dc7113f507cc0be3f698d4a9e466c85a1 /drivers/media/video/mt9v022.c | |
parent | 77110abbfbfd7673be6d18ef0875350eabee7532 (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/mt9v022.c')
-rw-r--r-- | drivers/media/video/mt9v022.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 56808cd2f8a9..0f4b204667e0 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -141,22 +141,22 @@ static int mt9v022_init(struct soc_camera_device *icd) | |||
141 | * plus snapshot mode to disable scan for now */ | 141 | * plus snapshot mode to disable scan for now */ |
142 | mt9v022->chip_control |= 0x10; | 142 | mt9v022->chip_control |= 0x10; |
143 | ret = reg_write(icd, MT9V022_CHIP_CONTROL, mt9v022->chip_control); | 143 | ret = reg_write(icd, MT9V022_CHIP_CONTROL, mt9v022->chip_control); |
144 | if (ret >= 0) | 144 | if (!ret) |
145 | reg_write(icd, MT9V022_READ_MODE, 0x300); | 145 | ret = reg_write(icd, MT9V022_READ_MODE, 0x300); |
146 | 146 | ||
147 | /* All defaults */ | 147 | /* All defaults */ |
148 | if (ret >= 0) | 148 | if (!ret) |
149 | /* AEC, AGC on */ | 149 | /* AEC, AGC on */ |
150 | ret = reg_set(icd, MT9V022_AEC_AGC_ENABLE, 0x3); | 150 | ret = reg_set(icd, MT9V022_AEC_AGC_ENABLE, 0x3); |
151 | if (ret >= 0) | 151 | if (!ret) |
152 | ret = reg_write(icd, MT9V022_MAX_TOTAL_SHUTTER_WIDTH, 480); | 152 | ret = reg_write(icd, MT9V022_MAX_TOTAL_SHUTTER_WIDTH, 480); |
153 | if (ret >= 0) | 153 | if (!ret) |
154 | /* default - auto */ | 154 | /* default - auto */ |
155 | ret = reg_clear(icd, MT9V022_BLACK_LEVEL_CALIB_CTRL, 1); | 155 | ret = reg_clear(icd, MT9V022_BLACK_LEVEL_CALIB_CTRL, 1); |
156 | if (ret >= 0) | 156 | if (!ret) |
157 | ret = reg_write(icd, MT9V022_DIGITAL_TEST_PATTERN, 0); | 157 | ret = reg_write(icd, MT9V022_DIGITAL_TEST_PATTERN, 0); |
158 | 158 | ||
159 | return ret >= 0 ? 0 : -EIO; | 159 | return ret; |
160 | } | 160 | } |
161 | 161 | ||
162 | static int mt9v022_release(struct soc_camera_device *icd) | 162 | static int mt9v022_release(struct soc_camera_device *icd) |
@@ -352,21 +352,21 @@ static int mt9v022_set_fmt_cap(struct soc_camera_device *icd, | |||
352 | rect->height + icd->y_skip_top + 43); | 352 | rect->height + icd->y_skip_top + 43); |
353 | } | 353 | } |
354 | /* Setup frame format: defaults apart from width and height */ | 354 | /* Setup frame format: defaults apart from width and height */ |
355 | if (ret >= 0) | 355 | if (!ret) |
356 | ret = reg_write(icd, MT9V022_COLUMN_START, rect->left); | 356 | ret = reg_write(icd, MT9V022_COLUMN_START, rect->left); |
357 | if (ret >= 0) | 357 | if (!ret) |
358 | ret = reg_write(icd, MT9V022_ROW_START, rect->top); | 358 | ret = reg_write(icd, MT9V022_ROW_START, rect->top); |
359 | if (ret >= 0) | 359 | if (!ret) |
360 | /* Default 94, Phytec driver says: | 360 | /* Default 94, Phytec driver says: |
361 | * "width + horizontal blank >= 660" */ | 361 | * "width + horizontal blank >= 660" */ |
362 | ret = reg_write(icd, MT9V022_HORIZONTAL_BLANKING, | 362 | ret = reg_write(icd, MT9V022_HORIZONTAL_BLANKING, |
363 | rect->width > 660 - 43 ? 43 : | 363 | rect->width > 660 - 43 ? 43 : |
364 | 660 - rect->width); | 364 | 660 - rect->width); |
365 | if (ret >= 0) | 365 | if (!ret) |
366 | ret = reg_write(icd, MT9V022_VERTICAL_BLANKING, 45); | 366 | ret = reg_write(icd, MT9V022_VERTICAL_BLANKING, 45); |
367 | if (ret >= 0) | 367 | if (!ret) |
368 | ret = reg_write(icd, MT9V022_WINDOW_WIDTH, rect->width); | 368 | ret = reg_write(icd, MT9V022_WINDOW_WIDTH, rect->width); |
369 | if (ret >= 0) | 369 | if (!ret) |
370 | ret = reg_write(icd, MT9V022_WINDOW_HEIGHT, | 370 | ret = reg_write(icd, MT9V022_WINDOW_HEIGHT, |
371 | rect->height + icd->y_skip_top); | 371 | rect->height + icd->y_skip_top); |
372 | 372 | ||
@@ -717,7 +717,7 @@ static int mt9v022_video_probe(struct soc_camera_device *icd) | |||
717 | icd->num_formats = 1; | 717 | icd->num_formats = 1; |
718 | } | 718 | } |
719 | 719 | ||
720 | if (ret >= 0) | 720 | if (!ret) |
721 | ret = soc_camera_video_start(icd); | 721 | ret = soc_camera_video_start(icd); |
722 | if (ret < 0) | 722 | if (ret < 0) |
723 | goto eisis; | 723 | goto eisis; |