Commit efe81b7b authored by Dan Carpenter's avatar Dan Carpenter Committed by Thomas Gleixner

irqchip/riscv-aplic: Fix an IS_ERR() vs NULL bug in probe()

The devm_platform_ioremap_resource() function doesn't return NULL, it
returns error pointers.  Fix the error handling to match.

Fixes: 2333df5a ("irqchip: Add RISC-V advanced PLIC driver for direct-mode")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/a5a628d6-81d8-4933-81a8-64aad4743ec4@stanley.mountain
parent f97fd458
......@@ -175,9 +175,9 @@ static int aplic_probe(struct platform_device *pdev)
/* Map the MMIO registers */
regs = devm_platform_ioremap_resource(pdev, 0);
if (!regs) {
if (IS_ERR(regs)) {
dev_err(dev, "failed map MMIO registers\n");
return -ENOMEM;
return PTR_ERR(regs);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment