Commit cbd5b438 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp-ov2680: Improve ov2680_set_fmt() error handling

Exit with an error on any i2c-write errors, rather then only
exiting with an error when ov2680_get_intg_factor() fails.
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 44a11920
......@@ -864,9 +864,11 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
/* s_power has not been called yet for std v4l2 clients (camorama) */
power_up(sd);
ret = ov2680_write_reg_array(client, dev->res->regs);
if (ret)
if (ret) {
dev_err(&client->dev,
"ov2680 write resolution register err: %d\n", ret);
goto err;
}
vts = dev->res->lines_per_frame;
......@@ -875,8 +877,10 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
vts = dev->exposure + OV2680_INTEGRATION_TIME_MARGIN;
ret = ov2680_write_reg(client, 2, OV2680_TIMING_VTS_H, vts);
if (ret)
if (ret) {
dev_err(&client->dev, "ov2680 write vts err: %d\n", ret);
goto err;
}
ret = ov2680_get_intg_factor(client, ov2680_info, res);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment