mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +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: 2f59ca1854 ("irqchip/starfive: Use devm_ interfaces to simplify resource release")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Link: https://patch.msgid.link/20260506041413.1670799-1-nichen@iscas.ac.cn
This commit is contained in:
parent
76841b0ea8
commit
8b9db67396
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user