From: Benoit Parrot <bparrot@ti.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Benoit Parrot <bparrot@ti.com>,
Jyri Sarha <jsarha@ti.com>
Subject: [Patch v5 2/8] media: i2c: ov2659: Fix sensor detection to actually fail when device is not present
Date: Mon, 30 Sep 2019 08:06:38 -0500 [thread overview]
Message-ID: <20190930130644.8704-3-bparrot@ti.com> (raw)
In-Reply-To: <20190930130644.8704-1-bparrot@ti.com>
Make sure that if the expected sensor device id register
is not recognized properly the failure is propagated
up so devices are not left partially initialized.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
drivers/media/i2c/ov2659.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 17573257097d..efbe6dc720e2 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1330,11 +1330,12 @@ static int ov2659_detect(struct v4l2_subdev *sd)
unsigned short id;
id = OV265X_ID(pid, ver);
- if (id != OV2659_ID)
+ if (id != OV2659_ID) {
dev_err(&client->dev,
"Sensor detection failed (%04X, %d)\n",
id, ret);
- else {
+ ret = -ENODEV;
+ } else {
dev_info(&client->dev, "Found OV%04X sensor\n", id);
ret = ov2659_init(sd, 0);
}
--
2.17.1
next prev parent reply other threads:[~2019-09-30 13:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 13:06 [Patch v5 0/8] media: i2c: ov2659: maintenance series Benoit Parrot
2019-09-30 13:06 ` [Patch v5 1/8] media: i2c: ov2659: Fix for image wrap-around in lower resolution Benoit Parrot
2019-09-30 13:06 ` Benoit Parrot [this message]
2019-09-30 13:06 ` [Patch v5 3/8] media: i2c: ov2659: Cleanup include file list Benoit Parrot
2019-09-30 13:06 ` [Patch v5 4/8] media: i2c: ov2659: fix s_stream return value Benoit Parrot
2019-10-01 6:04 ` Lad, Prabhakar
2019-09-30 13:06 ` [Patch v5 5/8] media: dt-bindings: ov2659: add powerdown/reset-gpios optional property Benoit Parrot
2019-09-30 13:06 ` [Patch v5 6/8] media: i2c: ov2659: Add powerdown/reset gpio handling Benoit Parrot
2019-10-01 6:03 ` Lad, Prabhakar
2019-09-30 13:06 ` [Patch v5 7/8] media: i2c: ov2659: Fix missing 720p register config Benoit Parrot
2019-09-30 13:06 ` [Patch v5 8/8] media: i2c: ov2659: Switch to SPDX Licensing Benoit Parrot
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=20190930130644.8704-3-bparrot@ti.com \
--to=bparrot@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@xs4all.nl \
--cc=jsarha@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.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).