From: Wei Yongjun Date: Tue, 29 Oct 2019 16:57:56 +0000 (-0700) Subject: soc: ti: omap-prm: fix return value check in omap_prm_probe() X-Git-Tag: v5.10.7~3704^2~14^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6b69bf143734a797b45e4728dc5ad80586d206c;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Santosh Shilimkar --- diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index db47a8b..96c6f77 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); }