[tip: irq/drivers] irqchip/starfive: Fix error check for devm_platform_ioremap_resource()
From: tip-bot2 for Chen Ni
Date: Wed May 06 2026 - 03:21:36 EST
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 8b9db67396105f6b95bcc57a354e50ac20705704
Gitweb: https://git.kernel.org/tip/8b9db67396105f6b95bcc57a354e50ac20705704
Author: Chen Ni <nichen@xxxxxxxxxxx>
AuthorDate: Wed, 06 May 2026 12:14:13 +08:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Wed, 06 May 2026 09:13:12 +02:00
irqchip/starfive: Fix error check for devm_platform_ioremap_resource()
devm_platform_ioremap_resource() 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>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Reviewed-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
Link: https://patch.msgid.link/20260506041413.1670799-1-nichen@xxxxxxxxxxx
---
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 0d59148..838885b 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))