From bffda5c87cf60d27a27f2e862c82c474f8e89767 Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Sat, 27 Jan 2007 20:54:24 +0100 Subject: [WATCHDOG] show default value for nowayout in module parameter change default=CONFIG_WATCHDOG_NOWAYOUT in the module parameter for nowayout by it's real value (0 or 1) by using: __MODULE_STRING(WATCHDOG_NOWAYOUT) Signed-off-by: Wim Van Sebroeck --- drivers/char/watchdog/alim7101_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char/watchdog/alim7101_wdt.c') diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c index bf25d0a55a9..1dacec5c963 100644 --- a/drivers/char/watchdog/alim7101_wdt.c +++ b/drivers/char/watchdog/alim7101_wdt.c @@ -78,7 +78,7 @@ static struct pci_dev *alim7101_pmu; static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" - __stringify(CONFIG_WATCHDOG_NOWAYOUT) ")"); + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); /* * Whack the dog -- cgit v1.2.3 From 82eb7c5059de64bd43f6b3cf3f128470f2b3fb83 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 8 Feb 2007 18:39:36 +0100 Subject: [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 Cc: Steve Hill Cc: Heiko Ronsdorf Cc: Fernando Fuganti Cc: Gergely Madarasz Cc: Ken Hollis Cc: Paul Mundt Signed-off-by: Wim Van Sebroeck Signed-off-by: Andrew Morton --- drivers/char/watchdog/alim7101_wdt.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'drivers/char/watchdog/alim7101_wdt.c') diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c index 1dacec5c963..c195078688d 100644 --- a/drivers/char/watchdog/alim7101_wdt.c +++ b/drivers/char/watchdog/alim7101_wdt.c @@ -69,7 +69,7 @@ module_param(use_gpio, int, 0); MODULE_PARM_DESC(use_gpio, "Use the gpio watchdog. (required by old cobalt boards)"); static void wdt_timer_ping(unsigned long); -static struct timer_list timer; +static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1); static unsigned long next_heartbeat; static unsigned long wdt_is_open; static char wdt_expect_close; @@ -108,8 +108,7 @@ static void wdt_timer_ping(unsigned long data) printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); } /* Re-set the timer interval */ - timer.expires = jiffies + WDT_INTERVAL; - add_timer(&timer); + mod_timer(&timer, jiffies + WDT_INTERVAL); } /* @@ -147,9 +146,7 @@ static void wdt_startup(void) wdt_change(WDT_ENABLE); /* Start the timer */ - timer.expires = jiffies + WDT_INTERVAL; - add_timer(&timer); - + mod_timer(&timer, jiffies + WDT_INTERVAL); printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); } @@ -380,10 +377,6 @@ static int __init alim7101_wdt_init(void) timeout); } - init_timer(&timer); - timer.function = wdt_timer_ping; - timer.data = 1; - rc = misc_register(&wdt_miscdev); if (rc) { printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", -- cgit v1.2.3