diff options
author | Leo Yan <leo.yan@linaro.org> | 2015-08-03 03:13:34 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-08-03 23:44:53 +0200 |
commit | 1fb6dd9da6ed4f2953b62162f3c498a1f6d7bfca (patch) | |
tree | 60159d6d75090c29efe483d47dd3590893e997c7 /drivers/clk/hisilicon | |
parent | clk: versatile: off by one in clk_sp810_timerclken_of_get() (diff) | |
download | linux-1fb6dd9da6ed4f2953b62162f3c498a1f6d7bfca.tar.xz linux-1fb6dd9da6ed4f2953b62162f3c498a1f6d7bfca.zip |
clk: hisi: refine parameter checking for init
*of_iomap()* will check the device node pointer, and if the pointer is
NULL it will return error code. So refine clock's init flow by checking
the device node with this simple way; and polish a little for the print
out message.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/hisilicon')
-rw-r--r-- | drivers/clk/hisilicon/clk.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c index 155e2e6c8316..9f8e76676553 100644 --- a/drivers/clk/hisilicon/clk.c +++ b/drivers/clk/hisilicon/clk.c @@ -44,14 +44,9 @@ struct hisi_clock_data __init *hisi_clk_init(struct device_node *np, struct clk **clk_table; void __iomem *base; - if (np) { - base = of_iomap(np, 0); - if (!base) { - pr_err("failed to map Hisilicon clock registers\n"); - goto err; - } - } else { - pr_err("failed to find Hisilicon clock node in DTS\n"); + base = of_iomap(np, 0); + if (!base) { + pr_err("%s: failed to map clock registers\n", __func__); goto err; } |