From: Afonso Figuinha <afonso.figuinha@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bingbu Cao <bingbu.cao@amd.com>,
Dan Scally <dan.scally@ideasonboard.com>,
Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] media: i2c: ov9734: Defer probe until the fwnode graph endpoint exists
Date: Thu, 5 Nov 2026 23:03:25 +0000 [thread overview]
Message-ID: <20261105230327.10852-3-afonso.figuinha@gmail.com> (raw)
In-Reply-To: <20261105230327.10852-1-afonso.figuinha@gmail.com>
On ACPI platforms with an Intel IPU the endpoint is created by the
ipu-bridge code when the CIO2 driver probes, which can happen after the
sensor driver probes. ov9734_check_hwcfg() then fails with -ENXIO and
the sensor is never bound.
Return -EPROBE_DEFER through dev_err_probe() when the endpoint is
missing, as other sensor drivers used on these platforms do. Return the
error from probe() as it is, so the deferral reason is kept and a
deferred probe does not log an error.
The change and this description were drafted with an AI coding
assistant (Claude Code, model Claude Opus 5.5). The author reviewed
them and tested them on a Microsoft Surface Laptop 1.
Signed-off-by: Afonso Figuinha <afonso.figuinha@gmail.com>
---
drivers/media/i2c/ov9734.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
index 8f39609ad..5f3e277b9 100644
--- a/drivers/media/i2c/ov9734.c
+++ b/drivers/media/i2c/ov9734.c
@@ -837,9 +837,14 @@ static int ov9734_check_hwcfg(struct device *dev)
if (!fwnode)
return -ENXIO;
+ /*
+ * Sometimes the fwnode graph is initialized by the bridge driver,
+ * wait for this.
+ */
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
if (!ep)
- return -ENXIO;
+ return dev_err_probe(dev, -EPROBE_DEFER,
+ "waiting for fwnode graph endpoint\n");
ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg);
fwnode_handle_put(ep);
@@ -893,11 +898,8 @@ static int ov9734_probe(struct i2c_client *client)
int ret;
ret = ov9734_check_hwcfg(&client->dev);
- if (ret) {
- dev_err(&client->dev, "failed to check HW configuration: %d",
- ret);
+ if (ret)
return ret;
- }
ov9734 = devm_kzalloc(&client->dev, sizeof(*ov9734), GFP_KERNEL);
if (!ov9734)
--
2.53.0
next prev parent reply other threads:[~2026-11-05 23:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 23:03 [PATCH 0/4] media: ov9734: Support the Microsoft Surface Laptop 1 front camera Afonso Figuinha
2026-11-05 23:03 ` [PATCH 1/4] media: ipu-bridge: Add OV9734 to the supported sensors list Afonso Figuinha
2026-11-05 23:03 ` Afonso Figuinha [this message]
2026-11-05 23:04 ` [PATCH 3/4] media: i2c: ov9734: Add reset GPIO, supplies and PM callbacks Afonso Figuinha
2026-11-05 23:05 ` [PATCH 4/4] media: i2c: ov9734: Support control events Afonso Figuinha
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=20261105230327.10852-3-afonso.figuinha@gmail.com \
--to=afonso.figuinha@gmail.com \
--cc=bingbu.cao@amd.com \
--cc=dan.scally@ideasonboard.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@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
all inboxes | Powered by JetHome®