aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/timer-riscv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/timer-riscv.c')
-rw-r--r--drivers/clocksource/timer-riscv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index 5e6038fbf115..09e031176bc6 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -55,7 +55,7 @@ static u64 riscv_sched_clock(void)
55 return get_cycles64(); 55 return get_cycles64();
56} 56}
57 57
58static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = { 58static struct clocksource riscv_clocksource = {
59 .name = "riscv_clocksource", 59 .name = "riscv_clocksource",
60 .rating = 300, 60 .rating = 300,
61 .mask = CLOCKSOURCE_MASK(64), 61 .mask = CLOCKSOURCE_MASK(64),
@@ -92,7 +92,6 @@ void riscv_timer_interrupt(void)
92static int __init riscv_timer_init_dt(struct device_node *n) 92static int __init riscv_timer_init_dt(struct device_node *n)
93{ 93{
94 int cpuid, hartid, error; 94 int cpuid, hartid, error;
95 struct clocksource *cs;
96 95
97 hartid = riscv_of_processor_hartid(n); 96 hartid = riscv_of_processor_hartid(n);
98 if (hartid < 0) { 97 if (hartid < 0) {
@@ -112,8 +111,7 @@ static int __init riscv_timer_init_dt(struct device_node *n)
112 111
113 pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n", 112 pr_info("%s: Registering clocksource cpuid [%d] hartid [%d]\n",
114 __func__, cpuid, hartid); 113 __func__, cpuid, hartid);
115 cs = per_cpu_ptr(&riscv_clocksource, cpuid); 114 error = clocksource_register_hz(&riscv_clocksource, riscv_timebase);
116 error = clocksource_register_hz(cs, riscv_timebase);
117 if (error) { 115 if (error) {
118 pr_err("RISCV timer register failed [%d] for cpu = [%d]\n", 116 pr_err("RISCV timer register failed [%d] for cpu = [%d]\n",
119 error, cpuid); 117 error, cpuid);