From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Rui Miguel Silva <rmfrfs@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kate Hsuan <hpa@redhat.com>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH resend 1/4] media: hi556: Return -EPROBE_DEFER if no endpoint is found
Date: Mon, 15 Apr 2024 11:25:19 +0000 [thread overview]
Message-ID: <Zh0Ony3cgMLQ3fCV@kekkonen.localdomain> (raw)
In-Reply-To: <20240415094133.210580-2-hdegoede@redhat.com>
Hi Hans,
On Mon, Apr 15, 2024 at 11:41:30AM +0200, Hans de Goede wrote:
> With ipu bridge, endpoints may only be created when ipu bridge has
> initialised. This may happen after the sensor driver has first probed.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/media/i2c/hi556.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c
> index 38c77d515786..96bae9914d52 100644
> --- a/drivers/media/i2c/hi556.c
> +++ b/drivers/media/i2c/hi556.c
> @@ -1206,8 +1206,13 @@ static int hi556_check_hwcfg(struct device *dev)
> int ret = 0;
> unsigned int i, j;
>
> - 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 -EPROBE_DEFER;
>
> ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
> if (ret) {
The endpoint needs to be put here. It might be more practical to parse the
endpoint right away so the error handling becomes easier.
> @@ -1220,10 +1225,6 @@ static int hi556_check_hwcfg(struct device *dev)
> return -EINVAL;
> }
>
> - 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)
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2024-04-15 11:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 9:41 [PATCH resend 0/4] media: hi556: Add reset / clk / regulator support Hans de Goede
2024-04-15 9:41 ` [PATCH resend 1/4] media: hi556: Return -EPROBE_DEFER if no endpoint is found Hans de Goede
2024-04-15 11:25 ` Sakari Ailus [this message]
2024-04-15 9:41 ` [PATCH resend 2/4] media: hi556: Add support for reset GPIO Hans de Goede
2024-04-15 9:41 ` [PATCH resend 3/4] media: hi556: Add support for external clock Hans de Goede
2024-04-15 9:41 ` [PATCH resend 4/4] media: hi556: Add support for avdd regulator Hans de Goede
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=Zh0Ony3cgMLQ3fCV@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=hpa@redhat.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rmfrfs@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