Skip to content

Commit fe5669e

Browse files
IoanaCiorneiThomas Gleixner
authored andcommitted
irqchip/ls-extirq: Fix devm_of_iomap() error check
The devm_of_iomap() function returns an ERR_PTR() encoded error code on failure. Replace the incorrect check against NULL with IS_ERR(). Fixes: 05cd654 ("irqchip/ls-extirq: Convert to a platform driver to make it work again") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260224113610.1129022-3-ioana.ciornei@nxp.com Closes: https://lore.kernel.org/all/aYXvfbfT6w0TMsXS@stanley.mountain/
1 parent e08f2ad commit fe5669e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/irqchip/irq-ls-extirq.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev)
190190
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
191191

192192
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
193-
if (!priv->intpcr)
194-
return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
193+
if (IS_ERR(priv->intpcr)) {
194+
return dev_err_probe(dev, PTR_ERR(priv->intpcr),
195+
"Cannot ioremap OF node %pOF\n", node);
196+
}
195197

196198
ret = ls_extirq_parse_map(priv, node);
197199
if (ret)

0 commit comments

Comments
 (0)