From 838a2ae80a6ab52139fb1bf0a93ea8c5eff94488 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 12 Jan 2013 11:50:05 +0000 Subject: 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 Cc: Nicolas Ferre Reviewed-by: Anton Vorontsov Acked-by: Kukjin Kim Cc: Russell King Cc: Sascha Hauer Cc: Jason Cooper Tested-by: Roland Stigge Acked-by: Eric Miao Cc: Haojian Zhuang Cc: David Brown Tested-by: Tony Lindgren Acked-by: Barry Song Tested-by: Stephen Warren Acked-by: Tony Prisk Cc: Lennert Buytenhek Cc: Wan ZongShun Acked-by: Viresh Kumar Acked-by: Arnd Bergmann Acked-by: Jason Cooper Reviewed-by: Thomas Gleixner Signed-off-by: Olof Johansson --- arch/arm/mach-netx/time.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-netx') diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c index e24c141ba489..d780a93e1cf7 100644 --- a/arch/arm/mach-netx/time.c +++ b/arch/arm/mach-netx/time.c @@ -76,7 +76,6 @@ static int netx_set_next_event(unsigned long evt, static struct clock_event_device netx_clockevent = { .name = "netx-timer" __stringify(TIMER_CLOCKEVENT), - .shift = 32, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, .set_next_event = netx_set_next_event, .set_mode = netx_set_mode, @@ -140,16 +139,11 @@ static void __init netx_timer_init(void) clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); - netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, - netx_clockevent.shift); - netx_clockevent.max_delta_ns = - clockevent_delta2ns(0xfffffffe, &netx_clockevent); /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. * Adding some safety ... */ - netx_clockevent.min_delta_ns = - clockevent_delta2ns(0xa00, &netx_clockevent); netx_clockevent.cpumask = cpumask_of(0); - clockevents_register_device(&netx_clockevent); + clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, + 0xa00, 0xfffffffe); } struct sys_timer netx_timer = { -- cgit v1.2.3