summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-10-29 19:57:56 +0300
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>2019-10-29 19:57:56 +0300
commitc6b69bf143734a797b45e4728dc5ad80586d206c (patch)
tree51a3940b24d98188d8e38c9368bc861fe18c95db /drivers
parent5478f912d225a1745a4b3d5f564daa0004d35a42 (diff)
downloadlinux-c6b69bf143734a797b45e4728dc5ad80586d206c.tar.xz
soc: ti: omap-prm: fix return value check in omap_prm_probe()
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 3e99cb214f03 ("soc: ti: add initial PRM driver with reset control support") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/soc/ti/omap_prm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c
index db47a8bceb87..96c6f777519c 100644
--- a/drivers/soc/ti/omap_prm.c
+++ b/drivers/soc/ti/omap_prm.c
@@ -375,8 +375,8 @@ static int omap_prm_probe(struct platform_device *pdev)
prm->data = data;
prm->base = devm_ioremap_resource(&pdev->dev, res);
- if (!prm->base)
- return -ENOMEM;
+ if (IS_ERR(prm->base))
+ return PTR_ERR(prm->base);
return omap_prm_reset_init(pdev, prm);
}