linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe()
@ 2019-10-11  5:24 Wei Yongjun
  2019-10-29 17:59 ` santosh.shilimkar
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-10-11  5:24 UTC (permalink / raw)
  To: Santosh Shilimkar, Tero Kristo
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, linux-arm-kernel

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>
---
 drivers/soc/ti/omap_prm.c | 4 ++--
 1 file 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);
 }




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe()
  2019-10-11  5:24 [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe() Wei Yongjun
@ 2019-10-29 17:59 ` santosh.shilimkar
  0 siblings, 0 replies; 2+ messages in thread
From: santosh.shilimkar @ 2019-10-29 17:59 UTC (permalink / raw)
  To: Wei Yongjun, Santosh Shilimkar, Tero Kristo
  Cc: kernel-janitors, linux-kernel, linux-arm-kernel



On 10/10/19 10:24 PM, Wei Yongjun wrote:
> 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>
> ---
Applied

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-29 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11  5:24 [PATCH -next] soc: ti: omap-prm: fix return value check in omap_prm_probe() Wei Yongjun
2019-10-29 17:59 ` santosh.shilimkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).