[PATCH 1/4] ARM: smp_twd: modernize clock event registration

Linus Walleij linus.walleij at stericsson.com
Mon Dec 12 04:56:45 EST 2011


From: Linus Walleij <linus.walleij at linaro.org>

This break-out from Colin Cross' cpufreq-aware TWD patch will
just modernize the clock event registration code to use
clockevents_config_and_register().

Signed-off-by: Colin Cross <ccross at android.com>
Cc: Russell King <linux at arm.linux.org.uk>
Acked-by: Thomas Gleixner <tglx at linutronix.de>
Acked-by: Rob Herring <rob.herring at calxeda.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar at ti.com>
[Broke out of larger SMP TWD patch]
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 arch/arm/kernel/smp_twd.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index a8a6682..f057561 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -173,15 +173,11 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 	clk->rating = 350;
 	clk->set_mode = twd_set_mode;
 	clk->set_next_event = twd_set_next_event;
-	clk->shift = 20;
-	clk->mult = div_sc(twd_timer_rate, NSEC_PER_SEC, clk->shift);
-	clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
-	clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
 
 	this_cpu_clk = __this_cpu_ptr(twd_evt);
 	*this_cpu_clk = clk;
 
-	clockevents_register_device(clk);
-
+	clockevents_config_and_register(clk, twd_timer_rate,
+					0xf, 0xffffffff);
 	enable_percpu_irq(clk->irq, 0);
 }
-- 
1.7.3.2




More information about the linux-arm-kernel mailing list