[PATCH 1/3] media: i2c: ov9734: Return -EPROBE_DEFER if no endpoint is found
From: Tin Posavec via B4 Relay
Date: Sat Oct 17 2026 - 04:34:09 EST
From: Tin Posavec <tin.posavec04@xxxxxxxxx>
With ipu-bridge, the fwnode graph endpoint of the sensor is only created
when ipu-bridge is initialized, which may happen after the sensor driver
has first probed. ov9734_check_hwcfg() then returns -ENXIO, so the probe
fails and is not retried, and the sensor stays unbound.
Return -EPROBE_DEFER instead, as several other sensor drivers used with
ipu-bridge do (e.g. ov2740 and hi556), and use dev_err_probe() to record
the reason for the deferral.
Also log an error when parsing the endpoint fails, as the link
frequency checks already do, and drop the generic error message from
probe, which would otherwise be logged on every deferred probe attempt.
Assisted-by: LLM
Signed-off-by: Tin Posavec <tin.posavec04@xxxxxxxxx>
---
drivers/media/i2c/ov9734.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
index 8f39609ad..f9280ef0e 100644
--- a/drivers/media/i2c/ov9734.c
+++ b/drivers/media/i2c/ov9734.c
@@ -837,14 +837,19 @@ 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);
if (ret)
- return ret;
+ return dev_err_probe(dev, ret, "failed to parse endpoint\n");
if (!bus_cfg.nr_of_link_frequencies) {
dev_err(dev, "no link frequencies defined");
@@ -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