@@ -153,3 +153,18 @@ bail_out:
kfree(clks);
kfree(cpuclk);
}
+
+static const __initconst struct of_device_id clk_cpu_match[] = {
+ {
+ .compatible = "marvell,armada-xp-cpu-clockctrl",
+ .data = of_cpu_clk_setup,
+ },
+ {
+ /* sentinel */
+ },
+};
+
+void __init mvebu_cpu_clk_init(void)
+{
+ of_clk_init(clk_cpu_match);
+}
@@ -13,6 +13,10 @@
#ifndef __MVEBU_CLK_CPU_H
#define __MVEBU_CLK_CPU_H
-void __init of_cpu_clk_setup(struct device_node *node);
+#ifdef CONFIG_MVEBU_CLK_CPU
+void __init mvebu_cpu_clk_init(void);
+#else
+static inline void mvebu_cpu_clk_init(void) {}
+#endif
#endif
@@ -19,21 +19,9 @@
#include "clk-cpu.h"
#include "clk-gating-ctrl.h"
-static const __initconst struct of_device_id clk_match[] = {
-#ifdef CONFIG_MVEBU_CLK_CPU
- {
- .compatible = "marvell,armada-xp-cpu-clockctrl",
- .data = of_cpu_clk_setup,
- },
-#endif
- {
- /* sentinel */
- }
-};
-
void __init mvebu_clocks_init(void)
{
mvebu_core_clk_init();
mvebu_clk_gating_init();
- of_clk_init(clk_match);
+ mvebu_cpu_clk_init();
}
Both the clk-core and clk-gating drivers define their compatible string in their own .c file and provide an initialization function to register the clock types. clk-cpu was not doing the same: it was defining its compatible string directly in clk.c, and calling of_clk_init() from here. For consistency reasons, this patch moves the clk-cpu compatible string in clk-cpu.c, and implements a proper mvebu_cpu_clk_init() function like the other two clock drivers. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- drivers/clk/mvebu/clk-cpu.c | 15 +++++++++++++++ drivers/clk/mvebu/clk-cpu.h | 6 +++++- drivers/clk/mvebu/clk.c | 14 +------------- 3 files changed, 21 insertions(+), 14 deletions(-)