clk: npcm7xx: fix return value check in npcm7xx_clk_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 26 Apr 2018 11:21:08 +0000 (11:21 +0000)
committerStephen Boyd <sboyd@kernel.org>
Tue, 1 May 2018 21:50:29 +0000 (14:50 -0700)
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>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-npcm7xx.c

index dba5384..740af90 100644 (file)
@@ -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) *