Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mach-u300: cleanup clockevent code

Use the new clockevents_config_and_register() function to register
the U300 clockevent, since that code requires ->cpumask to be set
we set this even on this UP system to please the framework.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+12 -21
+12 -21
arch/arm/mach-u300/timer.c
··· 27 27 #include <asm/mach/time.h> 28 28 #include <asm/mach/irq.h> 29 29 30 - /* Be able to sleep for atleast 4 seconds (usually more) */ 31 - #define APPTIMER_MIN_RANGE 4 32 - 33 30 /* 34 31 * APP side special timer registers 35 32 * This timer contains four timers which can fire an interrupt each. ··· 306 309 307 310 /* Use general purpose timer 1 as clock event */ 308 311 static struct clock_event_device clockevent_u300_1mhz = { 309 - .name = "GPT1", 310 - .rating = 300, /* Reasonably fast and accurate clock event */ 311 - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 312 - .set_next_event = u300_set_next_event, 313 - .set_mode = u300_set_mode, 312 + .name = "GPT1", 313 + .rating = 300, /* Reasonably fast and accurate clock event */ 314 + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 315 + .set_next_event = u300_set_next_event, 316 + .set_mode = u300_set_mode, 314 317 }; 315 318 316 319 /* Clock event timer interrupt handler */ ··· 325 328 } 326 329 327 330 static struct irqaction u300_timer_irq = { 328 - .name = "U300 Timer Tick", 329 - .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 330 - .handler = u300_timer_interrupt, 331 + .name = "U300 Timer Tick", 332 + .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 333 + .handler = u300_timer_interrupt, 331 334 }; 332 335 333 336 /* ··· 410 413 "GPT2", rate, 300, 32, clocksource_mmio_readl_up)) 411 414 pr_err("timer: failed to initialize U300 clock source\n"); 412 415 413 - clockevents_calc_mult_shift(&clockevent_u300_1mhz, 414 - rate, APPTIMER_MIN_RANGE); 415 - /* 32bit counter, so 32bits delta is max */ 416 - clockevent_u300_1mhz.max_delta_ns = 417 - clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz); 418 - /* This timer is slow enough to set for 1 cycle == 1 MHz */ 419 - clockevent_u300_1mhz.min_delta_ns = 420 - clockevent_delta2ns(1, &clockevent_u300_1mhz); 421 - clockevent_u300_1mhz.cpumask = cpumask_of(0); 422 - clockevents_register_device(&clockevent_u300_1mhz); 416 + /* Configure and register the clockevent */ 417 + clockevents_config_and_register(&clockevent_u300_1mhz, rate, 418 + 1, 0xffffffff); 419 + 423 420 /* 424 421 * TODO: init and register the rest of the timers too, they can be 425 422 * used by hrtimers!