aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/watchdog/w83877f_wdt.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-02-08 18:39:36 +0100
committerWim Van Sebroeck <wim@iguana.be>2007-02-12 22:43:02 +0100
commit82eb7c5059de64bd43f6b3cf3f128470f2b3fb83 (patch)
tree6735317bd9c19574f85fa7e21d0071562e824355 /drivers/char/watchdog/w83877f_wdt.c
parent35fcf53870eaa6cc966604a6e36df1c2c1577540 (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/w83877f_wdt.c')
-rw-r--r--drivers/char/watchdog/w83877f_wdt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
index 7dcd80aa737..3c88fe18f4f 100644
--- a/drivers/char/watchdog/w83877f_wdt.c
+++ b/drivers/char/watchdog/w83877f_wdt.c
@@ -90,7 +90,7 @@ module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
static void wdt_timer_ping(unsigned long);
-static struct timer_list timer;
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
static unsigned long next_heartbeat;
static unsigned long wdt_is_open;
static char wdt_expect_close;
@@ -114,8 +114,7 @@ static void wdt_timer_ping(unsigned long data)
inb_p(WDT_PING);
/* Re-set the timer interval */
- timer.expires = jiffies + WDT_INTERVAL;
- add_timer(&timer);
+ mod_timer(&timer, jiffies + WDT_INTERVAL);
spin_unlock(&wdt_spinlock);
@@ -155,8 +154,7 @@ static void wdt_startup(void)
next_heartbeat = jiffies + (timeout * HZ);
/* Start the timer */
- timer.expires = jiffies + WDT_INTERVAL;
- add_timer(&timer);
+ mod_timer(&timer, jiffies + WDT_INTERVAL);
wdt_change(WDT_ENABLE);
@@ -377,10 +375,6 @@ static int __init w83877f_wdt_init(void)
goto err_out_region1;
}
- init_timer(&timer);
- timer.function = wdt_timer_ping;
- timer.data = 0;
-
rc = misc_register(&wdt_miscdev);
if (rc)
{