On Mon Jun 23 13:00:33 2025 +0200, Hans de Goede wrote:
> The ov7251 driver waits for the endpoint fwnode to show up in case this
> fwnode is created by a bridge-driver.
> 
> It does this by returning -EPROBE_DEFER, but it does not use
> dev_err_probe() so no reason for deferring gets registered.
> 
> After 30 seconds the kernel logs a warning that the probe is still
> deferred, which looks like this:
> 
> [   33.952052] i2c i2c-INT347E:00: deferred probe pending: (reason unknown)
> 
> Use dev_err_probe() when returning -EPROBE_DEFER to register the probe
> deferral reason changing the error to:
> 
> deferred probe pending: waiting for fwnode graph endpoint
> 
> Also update the comment to not refer to the no longer existing cio2-bridge
> code.
> 
> Signed-off-by: Hans de Goede <hdego...@redhat.com>
> Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
> Signed-off-by: Hans Verkuil <hverk...@xs4all.nl>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/i2c/ov7251.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 3226888d77e9..31a42d81e970 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1486,9 +1486,14 @@ static int ov7251_check_hwcfg(struct ov7251 *ov7251)
        unsigned int i, j;
        int ret;
 
+       /*
+        * Sometimes the fwnode graph is initialized by the bridge driver
+        * Bridge drivers doing this may also add GPIO mappings, wait for this.
+        */
        endpoint = fwnode_graph_get_next_endpoint(fwnode, NULL);
        if (!endpoint)
-               return -EPROBE_DEFER; /* could be provided by cio2-bridge */
+               return dev_err_probe(ov7251->dev, -EPROBE_DEFER,
+                                    "waiting for fwnode graph endpoint\n");
 
        ret = v4l2_fwnode_endpoint_alloc_parse(endpoint, &bus_cfg);
        fwnode_handle_put(endpoint);

Reply via email to