spmi: pmic-arb: fix a NULL vs IS_ERR() check in spmi_pmic_arb_probe()
PATCH 1/1 spmi: pmic-arb: fix a NULL vs IS_ERR() check in spmi_pmic_arb_probe()
The devm_ioremap() function returns NULL on error, it doesn't return error pointers.
Fixes 231601cd22bd ("spmi: pmic-arb: Add support for PMIC v7")
Signed-off-by Peng Wu <[email protected]>
--- drivers/spmi/spmi-pmic-arb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/spmi/spmi-pmic-arb.c +6 -6
@@ -1462,8 +1462,8 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)*/ res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"core" ); core =devm_ioremap (&ctrl->dev, res->start,resource_size (res)); -if (IS_ERR (core)) { - err =PTR_ERR (core); +if (!core) { + err = -ENOMEM ; goto err_put_ctrl; }
@@ -1499,8 +1499,8 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev) "obsrvr"); pmic_arb->rd_base =devm_ioremap (&ctrl->dev, res->start,resource_size (res)); -if (IS_ERR (pmic_arb->rd_base)) { - err =PTR_ERR (pmic_arb->rd_base); +if (!pmic_arb->rd_base) { + err = -ENOMEM ; goto err_put_ctrl; }
@@ -1508,8 +1508,8 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev) "chnls"); pmic_arb->wr_base =devm_ioremap (&ctrl->dev, res->start,resource_size (res)); -if (IS_ERR (pmic_arb->wr_base)) { - err =PTR_ERR (pmic_arb->wr_base); +if (!pmic_arb->wr_base) { + err = -ENOMEM ; goto err_put_ctrl; } }
Signature · 1 line
2.17.1