diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-05-10 23:26:20 +0200 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-08-03 15:48:45 +0200 |
commit | 8cadd2831bf3abc94f4530e7fdbab7bb39b6b27d (patch) | |
tree | 4027798914cc3213692a4865797898a5ae0a0b49 /kernel/timer.c | |
parent | platform/x86: msi-laptop depends on SERIO_I8042 (diff) | |
download | linux-8cadd2831bf3abc94f4530e7fdbab7bb39b6b27d.tar.xz linux-8cadd2831bf3abc94f4530e7fdbab7bb39b6b27d.zip |
timer: add on-stack deferrable timer interfaces
In some cases (for instance with kernel threads) it may be desireable to
use on-stack deferrable timers to get their power saving benefits. Add
interfaces to support this for the IPS driver.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index ee305c8d4e18..efde11e197c4 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -577,6 +577,19 @@ static void __init_timer(struct timer_list *timer, lockdep_init_map(&timer->lockdep_map, name, key, 0); } +void setup_deferrable_timer_on_stack_key(struct timer_list *timer, + const char *name, + struct lock_class_key *key, + void (*function)(unsigned long), + unsigned long data) +{ + timer->function = function; + timer->data = data; + init_timer_on_stack_key(timer, name, key); + timer_set_deferrable(timer); +} +EXPORT_SYMBOL_GPL(setup_deferrable_timer_on_stack_key); + /** * init_timer_key - initialize a timer * @timer: the timer to be initialized |