[PATCH v2 1/3] media: i2c: ov9734: Return -EPROBE_DEFER if no endpoint is found
From: Tin Posavec via B4 Relay
Date: Mon Nov 09 2026 - 13:19:12 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.
Drop the check for a missing endpoint and return the error code of
v4l2_fwnode_endpoint_alloc_parse() instead, which is -EPROBE_DEFER for
a NULL endpoint since commit 8015a49d8b33 ("media: v4l2-fwnode: Return
-EPROBE_DEFER on parsing NULL endpoints"). Report the error with
dev_err_probe(), so that the reason for a deferral is recorded and
parsing errors are logged.
Also drop the generic error message from probe, which would otherwise
be logged on every deferred probe attempt.
Signed-off-by: Tin Posavec <tin.posavec04@xxxxxxxxx>
Tested-by: Afonso Figuinha <afonso.figuinha@xxxxxxxxx> # Surface Laptop 1 (IPU3)
---
drivers/media/i2c/ov9734.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c
index 8f39609ad..49711fa17 100644
--- a/drivers/media/i2c/ov9734.c
+++ b/drivers/media/i2c/ov9734.c
@@ -838,13 +838,10 @@ static int ov9734_check_hwcfg(struct device *dev)
return -ENXIO;
ep = fwnode_graph_get_next_endpoint(fwnode, NULL);
- if (!ep)
- return -ENXIO;
-
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 +890,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