diff mbox

[17/38] tick-common: call tick_install_replacement() from tick_check_new_device()

Message ID 1673b3362965e31fb45482f5df9e59bfcc2e3f53.1397492345.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar April 14, 2014, 4:23 p.m. UTC
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.kumar@linaro.org>
---
 kernel/time/tick-common.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox

Patch

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: