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/shwdt.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/shwdt.c')
-rw-r--r-- | drivers/char/watchdog/shwdt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c index dc403629aeb3..cecbedd473a4 100644 --- a/drivers/char/watchdog/shwdt.c +++ b/drivers/char/watchdog/shwdt.c | |||
@@ -65,10 +65,12 @@ static int clock_division_ratio = WTCSR_CKS_4096; | |||
65 | 65 | ||
66 | #define next_ping_period(cks) msecs_to_jiffies(cks - 4) | 66 | #define next_ping_period(cks) msecs_to_jiffies(cks - 4) |
67 | 67 | ||
68 | static void sh_wdt_ping(unsigned long data); | ||
69 | |||
68 | static unsigned long shwdt_is_open; | 70 | static unsigned long shwdt_is_open; |
69 | static struct watchdog_info sh_wdt_info; | 71 | static struct watchdog_info sh_wdt_info; |
70 | static char shwdt_expect_close; | 72 | static char shwdt_expect_close; |
71 | static struct timer_list timer; | 73 | static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0); |
72 | static unsigned long next_heartbeat; | 74 | static unsigned long next_heartbeat; |
73 | 75 | ||
74 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ | 76 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ |
@@ -433,10 +435,6 @@ static int __init sh_wdt_init(void) | |||
433 | "be 1<=x<=3600, using %d\n", heartbeat); | 435 | "be 1<=x<=3600, using %d\n", heartbeat); |
434 | } | 436 | } |
435 | 437 | ||
436 | init_timer(&timer); | ||
437 | timer.function = sh_wdt_ping; | ||
438 | timer.data = 0; | ||
439 | |||
440 | rc = register_reboot_notifier(&sh_wdt_notifier); | 438 | rc = register_reboot_notifier(&sh_wdt_notifier); |
441 | if (unlikely(rc)) { | 439 | if (unlikely(rc)) { |
442 | printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n", | 440 | printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n", |