[PATCH 2/4] media: i2c: ov9734: Defer probe until the fwnode graph endpoint exists
From: Afonso Figuinha
Date: Thu Nov 05 2026 - 18:04:07 EST
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@xxxxxxxxx>
---
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