@@ -583,7 +583,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;
@@ -604,24 +604,27 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
/* Read fixed clocks. These 3 clocks must be defined in DT */
clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_REFCLK);
- if (!IS_ERR(clk)) {
- pr_err("failed to find external REFCLK: %ld\n",
+ if (IS_ERR(clk)) {
+ pr_err("failed to find external REFCLK on device tree, err=%ld\n",
PTR_ERR(clk));
clk_put(clk);
+ goto npcm7xx_init_fail_no_clk_on_dt;
}
clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_SYSBYPCK);
- if (!IS_ERR(clk)) {
- pr_err("failed to find external SYSBYPCK: %ld\n",
+ if (IS_ERR(clk)) {
+ pr_err("failed to find external SYSBYPCK on device tree, err=%ld\n",
PTR_ERR(clk));
clk_put(clk);
+ goto npcm7xx_init_fail_no_clk_on_dt;
}
clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_MCBYPCK);
- if (!IS_ERR(clk)) {
- pr_err("failed to find external MCBYPCK: %ld\n",
+ if (IS_ERR(clk)) {
+ pr_err("failed to find external MCBYPCK on device tree, err=%ld\n",
PTR_ERR(clk));
clk_put(clk);
+ goto npcm7xx_init_fail_no_clk_on_dt;
}
/* Register plls */
@@ -705,6 +708,9 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
return;
+npcm7xx_init_fail_no_clk_on_dt:
+ pr_err("see Documentation/devicetree/bindings/clock/"
+ "nuvoton,npcm750-clk.txt for details\n");
npcm7xx_init_fail:
if (npcm7xx_clk_data->num)
kfree(npcm7xx_clk_data->hws);