diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-01-12 06:50:05 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-01-14 13:12:42 -0500 |
commit | 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488 (patch) | |
tree | 5e5fbbc2005b012318b7474f9c6057b9ff3f3814 /arch/arm/mach-msm/timer.c | |
parent | c35ef95c273c06471818f9245a05ac5a6e3ffa34 (diff) |
ARM: use clockevents_config_and_register() where possible
The clockevent core is able to figure out the best mult and shift,
calculate min_delta_ns and max_delta_ns, with the necessary info passed
into clockevents_config_and_register(). Use this combined configure
and register function where possible to make the codes less error prone
and gain some positive diff stat.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Tested-by: Roland Stigge <stigge@antcom.de>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: David Brown <davidb@codeaurora.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Barry Song <baohua.song@csr.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-msm/timer.c')
-rw-r--r-- | arch/arm/mach-msm/timer.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 476549a8a709..b9e7449adcde 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
@@ -144,13 +144,9 @@ static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt) | |||
144 | evt->rating = msm_clockevent.rating; | 144 | evt->rating = msm_clockevent.rating; |
145 | evt->set_mode = msm_timer_set_mode; | 145 | evt->set_mode = msm_timer_set_mode; |
146 | evt->set_next_event = msm_timer_set_next_event; | 146 | evt->set_next_event = msm_timer_set_next_event; |
147 | evt->shift = msm_clockevent.shift; | ||
148 | evt->mult = div_sc(GPT_HZ, NSEC_PER_SEC, evt->shift); | ||
149 | evt->max_delta_ns = clockevent_delta2ns(0xf0000000, evt); | ||
150 | evt->min_delta_ns = clockevent_delta2ns(4, evt); | ||
151 | 147 | ||
152 | *__this_cpu_ptr(msm_evt.percpu_evt) = evt; | 148 | *__this_cpu_ptr(msm_evt.percpu_evt) = evt; |
153 | clockevents_register_device(evt); | 149 | clockevents_config_and_register(evt, GPT_HZ, 4, 0xf0000000); |
154 | enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); | 150 | enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); |
155 | return 0; | 151 | return 0; |
156 | } | 152 | } |