Commit 21162d6c authored by Alexey Klimov's avatar Alexey Klimov Committed by Jiri Slaby

clockevents/drivers/exynos_mct: Remove unneeded container_of()

commit 479a9329 upstream.

Patch removes unneeded container_of() macro in exynos4_local_timer_setup().
Instead let's pass mevt pointer to setup and stop functions from
exynos4_mct_cpu_notify() and let them get evt pointer.

Tested on odroid-xu3.
Signed-off-by: default avatarAlexey Klimov <klimov.linux@gmail.com>
Acked-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 4b878ede
......@@ -398,13 +398,11 @@ static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
static int exynos4_local_timer_setup(struct clock_event_device *evt)
static int exynos4_local_timer_setup(struct mct_clock_event_device *mevt)
{
struct mct_clock_event_device *mevt;
struct clock_event_device *evt = &mevt->evt;
unsigned int cpu = smp_processor_id();
mevt = container_of(evt, struct mct_clock_event_device, evt);
mevt->base = EXYNOS4_MCT_L_BASE(cpu);
sprintf(mevt->name, "mct_tick%d", cpu);
......@@ -433,8 +431,10 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
return 0;
}
static void exynos4_local_timer_stop(struct clock_event_device *evt)
static void exynos4_local_timer_stop(struct mct_clock_event_device *mevt)
{
struct clock_event_device *evt = &mevt->evt;
evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
if (mct_int_type == MCT_INT_SPI) {
if (evt->irq != -1)
......@@ -456,11 +456,11 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self,
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_STARTING:
mevt = this_cpu_ptr(&percpu_mct_tick);
exynos4_local_timer_setup(&mevt->evt);
exynos4_local_timer_setup(mevt);
break;
case CPU_DYING:
mevt = this_cpu_ptr(&percpu_mct_tick);
exynos4_local_timer_stop(&mevt->evt);
exynos4_local_timer_stop(mevt);
break;
}
......@@ -526,7 +526,7 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem
goto out_irq;
/* Immediately configure the timer on the boot CPU */
exynos4_local_timer_setup(&mevt->evt);
exynos4_local_timer_setup(mevt);
return;
out_irq:
......
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