mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tin Posavec via B4 Relay <devnull+tin.posavec04.gmail.com@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Bingbu Cao <bingbu.cao@amd.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Dan Scally <dan.scally@ideasonboard.com>,
	Hans de Goede <hansg@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Afonso Figuinha <afonso.figuinha@gmail.com>,
	 Tin Posavec <tin.posavec04@gmail.com>
Subject: [PATCH v2 1/3] media: i2c: ov9734: Return -EPROBE_DEFER if no endpoint is found
Date: Mon, 09 Nov 2026 19:17:50 +0100	[thread overview]
Message-ID: <20261109-ov9734-ipu6-v2-1-0481b512c4c0@gmail.com> (raw)
In-Reply-To: <20261109-ov9734-ipu6-v2-0-0481b512c4c0@gmail.com>

From: Tin Posavec <tin.posavec04@gmail.com>

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@gmail.com>
Tested-by: Afonso Figuinha <afonso.figuinha@gmail.com> # 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



  reply	other threads:[~2026-11-09 18:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 18:17 [PATCH v2 0/3] media: ov9734, ipu-bridge: Enable the camera on the Intel NUC M15 Tin Posavec via B4 Relay
2026-11-09 18:17 ` Tin Posavec via B4 Relay [this message]
2026-11-09 18:17 ` [PATCH v2 2/3] media: i2c: ov9734: Add power on/off sequencing support Tin Posavec via B4 Relay
2026-11-09 18:17 ` [PATCH v2 3/3] media: ipu-bridge: Add OV9734 sensor config Tin Posavec via B4 Relay

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=20261109-ov9734-ipu6-v2-1-0481b512c4c0@gmail.com \
    --to=devnull+tin.posavec04.gmail.com@kernel.org \
    --cc=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=tin.posavec04@gmail.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®