Re: [PATCH v1 3/5] irqchip: starfive: Use devm_ interfaces to simplify resource release

Philipp Zabel
2026-04-10T09:27:32Z

On Fr, 2026-04-10 at 02:01 -0700, Changhuang Liang wrote:
> Use devm_ interfaces to simplify resource release. Make clock and reset
> get optional as they are not used on the JHB100 SoC. Replace pr_ logging
> with dev_* logging.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> ---
> drivers/irqchip/irq-starfive-jhb100-intc.c | 44 ++++++++--------------
> 1 file changed, 15 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/irqchip/irq-starfive-jhb100-intc.c b/drivers/irqchip/irq-starfive-jhb100-intc.c
> index 2c9cdad7f377..312a4634870a 100644
> --- a/drivers/irqchip/irq-starfive-jhb100-intc.c
> +++ b/drivers/irqchip/irq-starfive-jhb100-intc.c
[...]
> @@ -127,48 +125,44 @@ static int starfive_intc_probe(struct platform_device *pdev, struct device_node
> if (!irqc)
> return -ENOMEM;
>
> - irqc->base = of_iomap(intc, 0);
> + irqc->base = devm_platform_ioremap_resource(pdev, 0);
> if (!irqc->base) {
> - pr_err("Unable to map registers\n");
> + dev_err(&pdev->dev, "unable to map registers\n");
> ret = -ENXIO;
> goto err_free;
> }
>
> - rst = of_reset_control_get_exclusive(intc, NULL);
> + rst = devm_reset_control_get_optional(&pdev->dev, NULL);

Please use devm_reset_control_get_optional_exclusive() directly.

> if (IS_ERR(rst)) {
> - pr_err("Unable to get reset control %pe\n", rst);
> + dev_err(&pdev->dev, "Unable to get reset control %pe\n", rst);

Consider using dev_err_probe() to stop printing -EPROBE_DEFER.

regards
Philipp