Re: [PATCH v2 1/2] clk: eyeq: Use devm_platform_ioremap_resource()

From: Brian Masney

Date: Mon Sep 14 2026 - 12:59:34 EST


Hi Benoît,

On Mon, Sep 14, 2026 at 02:16:44PM +0200, 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.
>
> Suggested-by: Vladimir Kondratiev <vladimir.kondratiev@xxxxxxxxxxxx>
> Signed-off-by: Benoît Monin <benoit.monin@xxxxxxxxxxx>
> ---
> drivers/clk/clk-eyeq.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c
> index cf37feccc734..3662e6990bf7 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);
> +

As Sashiko pointed out, it would probably make sense to just convert the
rest of the driver over to use the devm_ variants where available (like
of_clk_add_hw_provider).

Brian