Part of tick_check_new_device() is exactly same as what's being done by
tick_install_replacement(). And so we can actually call
tick_install_replacement() directly from tick_check_new_device() instead of
replicating code.

Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
---
 kernel/time/tick-common.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index c2aa441..bb9a218 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -272,9 +272,7 @@ bool tick_check_preferred(struct clock_event_device *curdev,
  */
 void tick_check_new_device(struct clock_event_device *newdev)
 {
-       int cpu = smp_processor_id();
-       struct tick_device *td = tick_get_device(cpu);
-       struct clock_event_device *curdev = td->evtdev;
+       struct clock_event_device *curdev = tick_get_cpu_device()->evtdev;
 
        /* Preference decision */
        if (!tick_check_preferred(curdev, newdev))
@@ -292,10 +290,8 @@ void tick_check_new_device(struct clock_event_device 
*newdev)
                clockevents_shutdown(curdev);
                curdev = NULL;
        }
-       clockevents_exchange_device(curdev, newdev);
-       tick_setup_device(td, newdev, cpu);
-       if (newdev->features & CLOCK_EVT_FEAT_ONESHOT)
-               tick_oneshot_notify();
+
+       tick_install_replacement(newdev);
        return;
 
 out_bc:
-- 
1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to