Skip to content

Commit 8ad032c

Browse files
Dan CarpenterKAGA-KOKO
authored andcommitted
irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
devm_ioremap() doesn't return error pointers, it returns NULL on error. Update the check accordingly. Fixes: 221b110 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/22e1f4de-edce-4791-bd2d-2b2e98529492@moroto.mountain
1 parent f1c2765 commit 8ad032c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/irqchip/irq-qcom-mpm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)
389389
/* Don't use devm_ioremap_resource, as we're accessing a shared region. */
390390
priv->base = devm_ioremap(dev, res.start, resource_size(&res));
391391
of_node_put(msgram_np);
392-
if (IS_ERR(priv->base))
393-
return PTR_ERR(priv->base);
392+
if (!priv->base)
393+
return -ENOMEM;
394394
} else {
395395
/* Otherwise, fall back to simple MMIO. */
396396
priv->base = devm_platform_ioremap_resource(pdev, 0);

0 commit comments

Comments
 (0)