linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Tsuchiya Yuto <kitakar@gmail.com>,
	Andy Shevchenko <andy@kernel.org>,
	Yury Luneff <yury.lunev@gmail.com>,
	Nable <nable.maininbox@googlemail.com>,
	andrey.i.trufanov@gmail.com, Fabio Aiuto <fabioaiuto83@gmail.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH v2 04/13] media: atomisp-ov2680: Improve ov2680_set_fmt() error handling
Date: Mon, 22 Aug 2022 17:06:01 +0200	[thread overview]
Message-ID: <20220822150610.45186-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20220822150610.45186-1-hdegoede@redhat.com>

Exit with an error on any i2c-write errors, rather then only
exiting with an error when ov2680_get_intg_factor() fails.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index 9ac469878eea..5ba4c52a06a2 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -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) {
-- 
2.36.1


  parent reply	other threads:[~2022-08-22 15:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 15:05 [PATCH v2 01/13] media: atomisp_gmin_platform: Switch to use acpi_evaluate_dsm_typed() Hans de Goede
2022-08-22 15:05 ` [PATCH v2 02/13] media: atomisp-ov2680: Fix ov2680_set_fmt() Hans de Goede
2022-08-22 15:06 ` [PATCH v2 03/13] media: atomisp-ov2680: Don't take the input_lock for try_fmt calls Hans de Goede
2022-08-22 15:06 ` Hans de Goede [this message]
2022-08-22 15:06 ` [PATCH v2 05/13] media: atomisp-notes: Add info about sensors v4l2_get_subdev_hostdata() use Hans de Goede
2022-08-22 15:06 ` [PATCH v2 06/13] media: atomisp: Fix VIDIOC_TRY_FMT Hans de Goede
2022-08-22 15:06 ` [PATCH v2 07/13] media: atomisp: Make atomisp_try_fmt_cap() take padding into account Hans de Goede
2022-08-22 15:06 ` [PATCH v2 08/13] media: atomisp: hmm_bo: Simplify alloc_private_pages() Hans de Goede
2022-08-22 15:06 ` [PATCH v2 09/13] media: atomisp: hmm_bo: Further simplify alloc_private_pages() Hans de Goede
2022-08-22 15:06 ` [PATCH v2 10/13] media: atomisp: hmm_bo: Rewrite alloc_private_pages() using pages_array helper funcs Hans de Goede
2022-08-22 15:06 ` [PATCH v2 11/13] media: atomisp: hmm_bo: Rewrite free_private_pages() " Hans de Goede
2022-08-22 15:06 ` [PATCH v2 12/13] media: atomisp: hmm_bo: Drop PFN code path from alloc_user_pages() Hans de Goede
2022-08-22 15:06 ` [PATCH v2 13/13] media: atomisp: Ensure that USERPTR pointers are page aligned Hans de Goede
2022-08-22 21:28 ` [PATCH v2 01/13] media: atomisp_gmin_platform: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
2022-08-29 10:18   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220822150610.45186-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andrey.i.trufanov@gmail.com \
    --cc=andy@kernel.org \
    --cc=fabioaiuto83@gmail.com \
    --cc=kitakar@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nable.maininbox@googlemail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yury.lunev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).