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/plat-iop/time.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'arch/arm/plat-iop') diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index cbfbbe461788..837a2d52e9db 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c @@ -156,14 +156,9 @@ void __init iop_init_time(unsigned long tick_rate) write_tmr0(timer_ctl & ~IOP_TMR_EN); write_tisr(1); setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); - clockevents_calc_mult_shift(&iop_clockevent, - tick_rate, IOP_MIN_RANGE); - iop_clockevent.max_delta_ns = - clockevent_delta2ns(0xfffffffe, &iop_clockevent); - iop_clockevent.min_delta_ns = - clockevent_delta2ns(0xf, &iop_clockevent); iop_clockevent.cpumask = cpumask_of(0); - clockevents_register_device(&iop_clockevent); + clockevents_config_and_register(&iop_clockevent, tick_rate, + 0xf, 0xfffffffe); /* * Set up free-running clocksource timer 1. -- cgit v1.2.3-58-ga151