irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
Subsystems (2)
PATCH 1/1 irqchip/qcom-mpm: Fix IS_ERR() vs NULL check in qcom_mpm_init()
The devm_ioremap() function doesn't return error pointers, it returns NULL on error. Update the check accordingly.
Fixes 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/irqchip/irq-qcom-mpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-qcom-mpm.c +2 -2
@@ -389,8 +389,8 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)/* Don't use devm_ioremap_resource, as we're accessing a shared region. */ priv->base =devm_ioremap (dev, res.start,resource_size (&res));of_node_put (msgram_np); -if (IS_ERR (priv->base)) -return PTR_ERR (priv->base); +if (!priv->base) +return -ENOMEM ; }else {/* Otherwise, fall back to simple MMIO. */ priv->base =devm_platform_ioremap_resource (pdev,0 );
Signature · 1 line
2.43.0
Quoted 6 lines · Dan Carpenter
The
devm_ioremap()function doesn't return error pointers, it returns NULL on error. Update the check accordingly.Fixes 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")Signed-off-by Dan Carpenter <[email protected]>---
Thanks!
Reviewed-by Konrad Dybcio <[email protected]>
Konrad
The following commit has been merged into the irq/urgent branch of tip:
The following commit has been merged into the irq/urgent branch of tip:
Commit-ID: 8ad032cc8c499af6f3289c796f411e8874b50fdb Gitweb: https://git.kernel.org/tip/8ad032cc8c499af6f3289c796f411e8874b50fdb Author: Dan Carpenter <[email protected]> AuthorDate: Thu, 01 Feb 2024 15:17:50 +03:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Tue, 13 Feb 2024 10:26:15 +01:00
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 221b110d87c2 ("irqchip/qcom-mpm: Support passing a slice of SRAM as reg space")
Signed-off-by Dan Carpenter <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
Reviewed-by Konrad Dybcio <[email protected]>
--- drivers/irqchip/irq-qcom-mpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-qcom-mpm.c +2 -2
@@ -389,8 +389,8 @@ static int qcom_mpm_init(struct device_node *np, struct device_node *parent)/* Don't use devm_ioremap_resource, as we're accessing a shared region. */ priv->base =devm_ioremap (dev, res.start,resource_size (&res));of_node_put (msgram_np); -if (IS_ERR (priv->base)) -return PTR_ERR (priv->base); +if (!priv->base) +return -ENOMEM ; }else {/* Otherwise, fall back to simple MMIO. */ priv->base =devm_platform_ioremap_resource (pdev,0 );