sh: use common clock framework with device tree boards
authorRich Felker <dalias@libc.org>
Sun, 31 Jul 2016 03:11:30 +0000 (03:11 +0000)
committerRich Felker <dalias@libc.org>
Fri, 5 Aug 2016 03:29:45 +0000 (03:29 +0000)
Enable common clk framework for DT-based boards and disable code that
depends on the legacy sh clk framework when common clk is enabled.
Once legacy drivers are converted over, the old code can be removed
entirely.

Signed-off-by: Rich Felker <dalias@libc.org>
arch/sh/boards/Kconfig
arch/sh/kernel/cpu/clock.c

index e0db04664e2e2fb3f2a96863659f45ebd3d4443c..e9c2c42031fee497379af3e3fff29d519275eaee 100644 (file)
@@ -11,6 +11,7 @@ config SH_DEVICE_TREE
        select OF
        select OF_EARLY_FLATTREE
        select CLKSRC_OF
+       select COMMON_CLK
        select GENERIC_CALIBRATE_DELAY
        help
          Select Board Described by Device Tree to build a kernel that
index 4187cf4fe18583b74533536e9c491dee3246dcc9..fca9b1e78a63bcffa3969a11422b8c3c84264b0f 100644 (file)
@@ -24,11 +24,13 @@ int __init clk_init(void)
 {
        int ret;
 
+#ifndef CONFIG_COMMON_CLK
        ret = arch_clk_init();
        if (unlikely(ret)) {
                pr_err("%s: CPU clock registration failed.\n", __func__);
                return ret;
        }
+#endif
 
        if (sh_mv.mv_clk_init) {
                ret = sh_mv.mv_clk_init();
@@ -39,11 +41,13 @@ int __init clk_init(void)
                }
        }
 
+#ifndef CONFIG_COMMON_CLK
        /* Kick the child clocks.. */
        recalculate_root_clocks();
 
        /* Enable the necessary init clocks */
        clk_enable_init_clocks();
+#endif
 
        return ret;
 }