[v10,3/4] LoongArch: time: add of_clk_init in time_init

Message ID 20221129034157.15036-3-zhuyinbo@loongson.cn
State New
Headers
Series [v10,1/4] dt-bindings: clock: add loongson-2 clock include file |

Commit Message

Yinbo Zhu Nov. 29, 2022, 3:41 a.m. UTC
  The Loongson-2 clock controller driver used CLK_OF_DECLARE to
register clock subsystem that ask of_clk_init was called in
time_init and this patch was to addd such support.

Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
---
 arch/loongarch/kernel/time.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Stephen Boyd Feb. 10, 2023, 11:33 p.m. UTC | #1
Quoting Yinbo Zhu (2022-11-28 19:41:56)
> The Loongson-2 clock controller driver used CLK_OF_DECLARE to
> register clock subsystem that ask of_clk_init was called in
> time_init and this patch was to addd such support.
> 
> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>
  

Patch

diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c
index 786735dcc8d6..09f20bc81798 100644
--- a/arch/loongarch/kernel/time.c
+++ b/arch/loongarch/kernel/time.c
@@ -12,6 +12,7 @@ 
 #include <linux/kernel.h>
 #include <linux/sched_clock.h>
 #include <linux/spinlock.h>
+#include <linux/of_clk.h>
 
 #include <asm/cpu-features.h>
 #include <asm/loongarch.h>
@@ -214,6 +215,8 @@  int __init constant_clocksource_init(void)
 
 void __init time_init(void)
 {
+	of_clk_init(NULL);
+
 	if (!cpu_has_cpucfg)
 		const_clock_freq = cpu_clock_freq;
 	else