diff options
author | Chander Kashyap <chander.kashyap@linaro.org> | 2013-06-18 11:29:35 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-06-18 15:09:35 -0400 |
commit | 7114cd749a12ff9fd64a2f6f04919760f45ab183 (patch) | |
tree | 981442063bc1e979a057fb16878221227d7bdb4a | |
parent | 34dcedfbf97bc1c91c20f341e4ff4f70e53a0644 (diff) |
clocksource: exynos_mct: use (request/free)_irq calls for local timer registration
Replace the (setup/remove)_irq calls for local timer registration with
(request/free)_irq calls. This generalizes the local timer registration API.
Suggested by Mark Rutland.
Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | drivers/clocksource/exynos_mct.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 662fcc065821..a70480409ea5 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c | |||
@@ -400,18 +400,6 @@ static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id) | |||
400 | return IRQ_HANDLED; | 400 | return IRQ_HANDLED; |
401 | } | 401 | } |
402 | 402 | ||
403 | static struct irqaction mct_tick0_event_irq = { | ||
404 | .name = "mct_tick0_irq", | ||
405 | .flags = IRQF_TIMER | IRQF_NOBALANCING, | ||
406 | .handler = exynos4_mct_tick_isr, | ||
407 | }; | ||
408 | |||
409 | static struct irqaction mct_tick1_event_irq = { | ||
410 | .name = "mct_tick1_irq", | ||
411 | .flags = IRQF_TIMER | IRQF_NOBALANCING, | ||
412 | .handler = exynos4_mct_tick_isr, | ||
413 | }; | ||
414 | |||
415 | static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) | 403 | static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) |
416 | { | 404 | { |
417 | struct mct_clock_event_device *mevt; | 405 | struct mct_clock_event_device *mevt; |
@@ -435,16 +423,15 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) | |||
435 | exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); | 423 | exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET); |
436 | 424 | ||
437 | if (mct_int_type == MCT_INT_SPI) { | 425 | if (mct_int_type == MCT_INT_SPI) { |
438 | if (cpu == 0) { | 426 | evt->irq = mct_irqs[MCT_L0_IRQ + cpu]; |
439 | mct_tick0_event_irq.dev_id = mevt; | 427 | if (request_irq(evt->irq, exynos4_mct_tick_isr, |
440 | evt->irq = mct_irqs[MCT_L0_IRQ]; | 428 | IRQF_TIMER | IRQF_NOBALANCING, |
441 | setup_irq(evt->irq, &mct_tick0_event_irq); | 429 | evt->name, mevt)) { |
442 | } else { | 430 | pr_err("exynos-mct: cannot register IRQ %d\n", |
443 | mct_tick1_event_irq.dev_id = mevt; | 431 | evt->irq); |
444 | evt->irq = mct_irqs[MCT_L1_IRQ]; | 432 | return -EIO; |
445 | setup_irq(evt->irq, &mct_tick1_event_irq); | ||
446 | irq_set_affinity(evt->irq, cpumask_of(1)); | ||
447 | } | 433 | } |
434 | irq_set_affinity(evt->irq, cpumask_of(cpu)); | ||
448 | } else { | 435 | } else { |
449 | enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0); | 436 | enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0); |
450 | } | 437 | } |
@@ -454,13 +441,9 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt) | |||
454 | 441 | ||
455 | static void exynos4_local_timer_stop(struct clock_event_device *evt) | 442 | static void exynos4_local_timer_stop(struct clock_event_device *evt) |
456 | { | 443 | { |
457 | unsigned int cpu = smp_processor_id(); | ||
458 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); | 444 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); |
459 | if (mct_int_type == MCT_INT_SPI) | 445 | if (mct_int_type == MCT_INT_SPI) |
460 | if (cpu == 0) | 446 | free_irq(evt->irq, this_cpu_ptr(&percpu_mct_tick)); |
461 | remove_irq(evt->irq, &mct_tick0_event_irq); | ||
462 | else | ||
463 | remove_irq(evt->irq, &mct_tick1_event_irq); | ||
464 | else | 447 | else |
465 | disable_percpu_irq(mct_irqs[MCT_L0_IRQ]); | 448 | disable_percpu_irq(mct_irqs[MCT_L0_IRQ]); |
466 | } | 449 | } |