Commit f7ea3060 authored by Andrew Bresticker's avatar Andrew Bresticker Committed by Ralf Baechle

clocksource: mips-gic: Use percpu_dev_id

Since the GIC timer IRQ is a percpu IRQ, we can use percpu_dev_id
to pass the IRQ handler the correct clock_event_device.
Signed-off-by: default avatarAndrew Bresticker <abrestic@chromium.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8138/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 001f5fe7
...@@ -39,17 +39,16 @@ static void gic_set_clock_mode(enum clock_event_mode mode, ...@@ -39,17 +39,16 @@ static void gic_set_clock_mode(enum clock_event_mode mode,
static irqreturn_t gic_compare_interrupt(int irq, void *dev_id) static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
{ {
struct clock_event_device *cd; struct clock_event_device *cd = dev_id;
int cpu = smp_processor_id();
gic_write_compare(gic_read_compare()); gic_write_compare(gic_read_compare());
cd = &per_cpu(gic_clockevent_device, cpu);
cd->event_handler(cd); cd->event_handler(cd);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
struct irqaction gic_compare_irqaction = { struct irqaction gic_compare_irqaction = {
.handler = gic_compare_interrupt, .handler = gic_compare_interrupt,
.percpu_dev_id = &gic_clockevent_device,
.flags = IRQF_PERCPU | IRQF_TIMER, .flags = IRQF_PERCPU | IRQF_TIMER,
.name = "timer", .name = "timer",
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment