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

From: Thomas Gleixner

Date: Fri Apr 10 2026 - 10:38:59 EST


On Fri, Apr 10 2026 at 02:01, Changhuang Liang wrote:
> - 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;

You can eliminate err_free as well by doing:

struct startfive_irq_chip *irqc __free(kfree) = kzalloc_obj(*irqc);

....
dev_info(..);

retain_and_null_ptr(irqc);
return 0;

Thanks,

tglx