Re: [PATCH] irqchip/starfive: Fix error check for devm_platform_ioremap_resource()
From: Changhuang Liang
Date: Wed May 06 2026 - 02:53:42 EST
Hi, Chen
Thanks for the patch.
> The devm_platform_ioremap_resource() function returns an error pointer on
> failure, not NULL. Fix the check to use IS_ERR() and return PTR_ERR() to
> correctly handle allocation failures.
>
> Fixes: 2f59ca185497 ("irqchip/starfive: Use devm_ interfaces to simplify
> resource release")
> Signed-off-by: Chen Ni <nichen@xxxxxxxxxxx>
Reviewed-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
Best Regards,
Changhuang
> ---
> drivers/irqchip/irq-starfive-jhb100-intc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-starfive-jhb100-intc.c
> b/drivers/irqchip/irq-starfive-jhb100-intc.c
> index 0d5914813afd..838885b02f34 100644
> --- a/drivers/irqchip/irq-starfive-jhb100-intc.c
> +++ b/drivers/irqchip/irq-starfive-jhb100-intc.c
> @@ -208,8 +208,8 @@ static int starfive_intc_probe(struct platform_device
> *pdev, struct device_node
> return -ENOMEM;
>
> irqc->base = devm_platform_ioremap_resource(pdev, 0);
> - if (!irqc->base)
> - return dev_err_probe(&pdev->dev, -ENXIO, "unable to map
> registers\n");
> + if (IS_ERR(irqc->base))
> + return dev_err_probe(&pdev->dev, PTR_ERR(irqc->base), "unable to
> map
> +registers\n");
>
> rst =
> devm_reset_control_get_optional_exclusive_deasserted(&pdev->dev, NULL);
> if (IS_ERR(rst))
> --
> 2.25.1