From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Benoît Monin" <benoit.monin@bootlin.com>,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Brian Masney" <bmasney+clk@redhat.com>,
"Jerome Brunet" <jbrunet+clk@baylibre.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
<linux-mips@vger.kernel.org>, <linux-clk@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clk: eyeq: Use devm_platform_ioremap_resource()
Date: Fri, 11 Sep 2026 14:10:22 +0200 [thread overview]
Message-ID: <DLCH5YITTX2H.2ZSGAKJ5WFCR6@bootlin.com> (raw)
In-Reply-To: <20260911-clk-eyeq-res-v1-1-39b04542db38@bootlin.com>
Hello Benoît,
On Fri Sep 11, 2026 at 1:48 PM CEST, Benoît Monin wrote:
> Convert eqc_probe() from the open-coded platform_get_resource() +
> ioremap() sequence to devm_platform_ioremap_resource(). Besides less
> code, this requests the memory region so the OLB registers are properly
> reserved in the iomem_resource tree.
>
> Move devm_platform_ioremap_resource() before checking for device match
> data, so OLBs bound without match data also get their memory region
> mapped and reserved.
>
> Add an entry for mobileye,eyeq6h-central-olb without match data: its
> clocks are all registered by the early init and it has no auxiliary
> devices, so probe() now reserves its region and stops there.
>
> Suggested-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
> Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
> ---
> drivers/clk/clk-eyeq.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c
> index cf37feccc734..bb680283b6f2 100644
> --- a/drivers/clk/clk-eyeq.c
> +++ b/drivers/clk/clk-eyeq.c
> @@ -513,21 +513,16 @@ static int eqc_probe(struct platform_device *pdev)
> const struct eqc_match_data *data;
> struct clk_hw_onecell_data *cells;
> unsigned int i, clk_count;
> - struct resource *res;
> void __iomem *base;
> int ret;
>
> + base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(base))
> + return PTR_ERR(base);
> +
> data = device_get_match_data(dev);
> if (!data)
> - return 0; /* No clocks nor auxdevs, we are done. */
> -
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res)
> - return -ENODEV;
> -
> - base = ioremap(res->start, resource_size(res));
> - if (!base)
> - return -ENOMEM;
> + return 0; /* Early only clocks, stop here but keep resource reserved */
Technically it is "early only clocks OR auxdevs", as is seen in.
Not that it matters much.
static const struct eqc_match_data eqc_eyeq6h_west_match_data = {
.reset_auxdev_name = "reset_west",
};
>
> /* Init optional auxiliary devices. */
> eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name);
> @@ -1175,6 +1170,7 @@ static const struct of_device_id eqc_match_table[] = {
> { .compatible = "mobileye,eyeq5-olb", .data = &eqc_eyeq5_match_data },
> { .compatible = "mobileye,eyeq6l-olb", .data = &eqc_eyeq6l_match_data },
> { .compatible = "mobileye,eyeq6lplus-olb", .data = &eqc_eyeq6lplus_match_data },
> + { .compatible = "mobileye,eyeq6h-central-olb" /* no data, early only */ },
> { .compatible = "mobileye,eyeq6h-west-olb", .data = &eqc_eyeq6h_west_match_data },
> { .compatible = "mobileye,eyeq6h-east-olb", .data = &eqc_eyeq6h_east_match_data },
> { .compatible = "mobileye,eyeq6h-south-olb", .data = &eqc_eyeq6h_south_match_data },
I can confirm this is the way to go! The open-coded
platform_get_resource() + ioremap() sequence is heritage from how the
series used to look during its first revisions.
Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com>
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-09-11 12:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 11:48 Benoît Monin
2026-09-11 12:10 ` Théo Lebrun [this message]
2026-09-11 23:53 ` Brian Masney
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=DLCH5YITTX2H.2ZSGAKJ5WFCR6@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=benoit.monin@bootlin.com \
--cc=bmasney+clk@redhat.com \
--cc=gregory.clement@bootlin.com \
--cc=jbrunet+clk@baylibre.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.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®