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-lpc32xx/timer.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch/arm/mach-lpc32xx') diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c index c40667c33161..502b3c6ee295 100644 --- a/arch/arm/mach-lpc32xx/timer.c +++ b/arch/arm/mach-lpc32xx/timer.c @@ -70,7 +70,6 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode, static struct clock_event_device lpc32xx_clkevt = { .name = "lpc32xx_clkevt", .features = CLOCK_EVT_FEAT_ONESHOT, - .shift = 32, .rating = 300, .set_next_event = lpc32xx_clkevt_next_event, .set_mode = lpc32xx_clkevt_mode, @@ -141,14 +140,8 @@ static void __init lpc32xx_timer_init(void) setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq); /* Setup the clockevent structure. */ - lpc32xx_clkevt.mult = div_sc(clkrate, NSEC_PER_SEC, - lpc32xx_clkevt.shift); - lpc32xx_clkevt.max_delta_ns = clockevent_delta2ns(-1, - &lpc32xx_clkevt); - lpc32xx_clkevt.min_delta_ns = clockevent_delta2ns(1, - &lpc32xx_clkevt) + 1; lpc32xx_clkevt.cpumask = cpumask_of(0); - clockevents_register_device(&lpc32xx_clkevt); + clockevents_config_and_register(&lpc32xx_clkevt, clkrate, 1, -1); /* Use timer1 as clock source. */ __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET, -- cgit v1.2.3