@@ -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:
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(-)