@@ -363,15 +363,17 @@ void tick_suspend(void)
void tick_resume(void)
{
struct tick_device *td = tick_get_cpu_device();
+ struct clock_event_device *dev = td->evtdev;
int broadcast = tick_resume_broadcast();
- clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_RESUME);
+ clockevents_set_mode(dev, CLOCK_EVT_MODE_RESUME);
if (!broadcast) {
if (td->mode == TICKDEV_MODE_PERIODIC)
- tick_setup_periodic(td->evtdev, 0);
+ tick_setup_periodic(dev, 0);
else
- tick_resume_oneshot();
+ tick_setup_oneshot(dev, dev->event_handler,
+ ktime_get());
}
}
@@ -43,7 +43,6 @@ extern int tick_program_event(ktime_t expires, int force);
extern void tick_oneshot_notify(void);
extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *));
extern int tick_is_oneshot_available(void);
-extern void tick_resume_oneshot(void);
# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
extern int tick_broadcast_oneshot_control(unsigned long reason);
@@ -74,10 +73,6 @@ void tick_setup_oneshot(struct clock_event_device *newdev,
{
BUG();
}
-static inline void tick_resume_oneshot(void)
-{
- BUG();
-}
static inline int tick_program_event(ktime_t expires, int force)
{
return 0;
@@ -32,17 +32,6 @@ int tick_program_event(ktime_t expires, int force)
}
/**
- * tick_resume_onshot - resume oneshot mode
- */
-void tick_resume_oneshot(void)
-{
- struct clock_event_device *dev = tick_get_cpu_device()->evtdev;
-
- clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
- clockevents_program_event(dev, ktime_get(), true);
-}
-
-/**
* tick_setup_oneshot - setup the event device for oneshot mode (hres or nohz)
*/
void tick_setup_oneshot(struct clock_event_device *newdev,
tick_resume_oneshot() and tick_setup_oneshot() have almost the same implementation and tick_setup_oneshot() can be used easily instead of tick_resume_oneshot(). So, remove tick_resume_oneshot() and use tick_setup_oneshot() in its place. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- kernel/time/tick-common.c | 8 +++++--- kernel/time/tick-internal.h | 5 ----- kernel/time/tick-oneshot.c | 11 ----------- 3 files changed, 5 insertions(+), 19 deletions(-)