diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-08 12:39:36 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2007-02-12 16:43:02 -0500 |
commit | 82eb7c5059de64bd43f6b3cf3f128470f2b3fb83 (patch) | |
tree | 6735317bd9c19574f85fa7e21d0071562e824355 /drivers/char/watchdog/cpu5wdt.c | |
parent | 35fcf53870eaa6cc966604a6e36df1c2c1577540 (diff) |
[WATCHDOG] timers cleanup
- Use timer macros to set function and data members and to modify
expiration time.
- Use DEFINE_TIMER for single (platform dependent) watchdog timers and
do not init them at run-time in these cases.
- del_timer_sync is common in most cases -- we want to wait for timer
function if it's still running.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Steve Hill <steve@navaho.co.uk>
Cc: Heiko Ronsdorf <hero@ihg.uni-duisburg.de>
Cc: Fernando Fuganti <fuganti@conectiva.com.br>
Cc: Gergely Madarasz <gorgo@itc.hu>
Cc: Ken Hollis <khollis@bitgate.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char/watchdog/cpu5wdt.c')
-rw-r--r-- | drivers/char/watchdog/cpu5wdt.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c index 00bdabb90f27..bcd7e36ca0aa 100644 --- a/drivers/char/watchdog/cpu5wdt.c +++ b/drivers/char/watchdog/cpu5wdt.c | |||
@@ -80,10 +80,8 @@ static void cpu5wdt_trigger(unsigned long unused) | |||
80 | outb(1, port + CPU5WDT_TRIGGER_REG); | 80 | outb(1, port + CPU5WDT_TRIGGER_REG); |
81 | 81 | ||
82 | /* requeue?? */ | 82 | /* requeue?? */ |
83 | if( cpu5wdt_device.queue && ticks ) { | 83 | if (cpu5wdt_device.queue && ticks) |
84 | cpu5wdt_device.timer.expires = jiffies + CPU5WDT_INTERVAL; | 84 | mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL); |
85 | add_timer(&cpu5wdt_device.timer); | ||
86 | } | ||
87 | else { | 85 | else { |
88 | /* ticks doesn't matter anyway */ | 86 | /* ticks doesn't matter anyway */ |
89 | complete(&cpu5wdt_device.stop); | 87 | complete(&cpu5wdt_device.stop); |
@@ -109,8 +107,7 @@ static void cpu5wdt_start(void) | |||
109 | outb(1, port + CPU5WDT_MODE_REG); | 107 | outb(1, port + CPU5WDT_MODE_REG); |
110 | outb(0, port + CPU5WDT_RESET_REG); | 108 | outb(0, port + CPU5WDT_RESET_REG); |
111 | outb(0, port + CPU5WDT_ENABLE_REG); | 109 | outb(0, port + CPU5WDT_ENABLE_REG); |
112 | cpu5wdt_device.timer.expires = jiffies + CPU5WDT_INTERVAL; | 110 | mod_timer(&cpu5wdt_device.timer, jiffies + CPU5WDT_INTERVAL); |
113 | add_timer(&cpu5wdt_device.timer); | ||
114 | } | 111 | } |
115 | /* if process dies, counter is not decremented */ | 112 | /* if process dies, counter is not decremented */ |
116 | cpu5wdt_device.running++; | 113 | cpu5wdt_device.running++; |
@@ -245,9 +242,7 @@ static int __devinit cpu5wdt_init(void) | |||
245 | 242 | ||
246 | clear_bit(0, &cpu5wdt_device.inuse); | 243 | clear_bit(0, &cpu5wdt_device.inuse); |
247 | 244 | ||
248 | init_timer(&cpu5wdt_device.timer); | 245 | setup_timer(&cpu5wdt_device.timer, cpu5wdt_trigger, 0); |
249 | cpu5wdt_device.timer.function = cpu5wdt_trigger; | ||
250 | cpu5wdt_device.timer.data = 0; | ||
251 | 246 | ||
252 | cpu5wdt_device.default_ticks = ticks; | 247 | cpu5wdt_device.default_ticks = ticks; |
253 | 248 | ||