aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <[email protected]>2015-07-16 16:28:46 +0530
committerThomas Gleixner <[email protected]>2015-07-30 21:25:38 +0200
commitc2e13cc2cea64385043fa9afaaf91a74ec438467 (patch)
tree839cf8593eeb6c0f62d0a6734a39b6dbd1bf40d4
parent5054e1e63946abff39bc7b154fac049110d9d3bb (diff)
x86/lguest/timer: Migrate to new set-state interface
Migrate lguest driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. We weren't doing anything while switching modes other than in shutdown mode and so those are not implemented. Signed-off-by: Viresh Kumar <[email protected]> Acked-and-tested-by: Rusty Russell <[email protected]> Cc: [email protected] Cc: Alexander Kuleshov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Jan Beulich <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: [email protected] (open list:LGUEST) Link: http://lkml.kernel.org/r/b96f1c308f4523255c5394a4e6e13f2b67685402.1437042675.git.viresh.kumar@linaro.org Signed-off-by: Thomas Gleixner <[email protected]>
-rw-r--r--arch/x86/lguest/boot.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index f2dc08c003eb..433e5a7dd37f 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -985,23 +985,11 @@ static int lguest_clockevent_set_next_event(unsigned long delta,
return 0;
}
-static void lguest_clockevent_set_mode(enum clock_event_mode mode,
- struct clock_event_device *evt)
-{
- switch (mode) {
- case CLOCK_EVT_MODE_UNUSED:
- case CLOCK_EVT_MODE_SHUTDOWN:
- /* A 0 argument shuts the clock down. */
- hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0);
- break;
- case CLOCK_EVT_MODE_ONESHOT:
- /* This is what we expect. */
- break;
- case CLOCK_EVT_MODE_PERIODIC:
- BUG();
- case CLOCK_EVT_MODE_RESUME:
- break;
- }
+static int lguest_clockevent_shutdown(struct clock_event_device *evt)
+{
+ /* A 0 argument shuts the clock down. */
+ hcall(LHCALL_SET_CLOCKEVENT, 0, 0, 0, 0);
+ return 0;
}
/* This describes our primitive timer chip. */
@@ -1009,7 +997,7 @@ static struct clock_event_device lguest_clockevent = {
.name = "lguest",
.features = CLOCK_EVT_FEAT_ONESHOT,
.set_next_event = lguest_clockevent_set_next_event,
- .set_mode = lguest_clockevent_set_mode,
+ .set_state_shutdown = lguest_clockevent_shutdown,
.rating = INT_MAX,
.mult = 1,
.shift = 0,