public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init()
@ 2018-04-26 11:21 Wei Yongjun
  2018-05-01 21:50 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Yongjun @ 2018-04-26 11:21 UTC (permalink / raw)
  To: Tali Perry, Stephen Boyd; +Cc: Wei Yongjun, openbmc, linux-clk, kernel-janitors

In case of error, the function ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/clk/clk-npcm7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c
index dba5384..740af90 100644
--- a/drivers/clk/clk-npcm7xx.c
+++ b/drivers/clk/clk-npcm7xx.c
@@ -555,7 +555,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
 	}
 
 	clk_base = ioremap(res.start, resource_size(&res));
-	if (IS_ERR(clk_base))
+	if (!clk_base)
 		goto npcm7xx_init_error;
 
 	npcm7xx_clk_data = kzalloc(sizeof(*npcm7xx_clk_data->hws) *


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

end of thread, other threads:[~2018-05-02 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 11:21 [PATCH -next] clk: npcm7xx: fix return value check in npcm7xx_clk_init() Wei Yongjun
2018-05-01 21:50 ` Stephen Boyd
2018-05-02  9:19   ` Tali Perry
2018-05-02 10:36     ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox