diff options
Diffstat (limited to 'drivers/char/watchdog/sc520_wdt.c')
-rw-r--r-- | drivers/char/watchdog/sc520_wdt.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c index caec37ba750a..2676a43895a7 100644 --- a/drivers/char/watchdog/sc520_wdt.c +++ b/drivers/char/watchdog/sc520_wdt.c | |||
@@ -97,7 +97,7 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, defau | |||
97 | 97 | ||
98 | static int nowayout = WATCHDOG_NOWAYOUT; | 98 | static int nowayout = WATCHDOG_NOWAYOUT; |
99 | module_param(nowayout, int, 0); | 99 | module_param(nowayout, int, 0); |
100 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 100 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * AMD Elan SC520 - Watchdog Timer Registers | 103 | * AMD Elan SC520 - Watchdog Timer Registers |
@@ -121,7 +121,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CON | |||
121 | static __u16 __iomem *wdtmrctl; | 121 | static __u16 __iomem *wdtmrctl; |
122 | 122 | ||
123 | static void wdt_timer_ping(unsigned long); | 123 | static void wdt_timer_ping(unsigned long); |
124 | static struct timer_list timer; | 124 | static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); |
125 | static unsigned long next_heartbeat; | 125 | static unsigned long next_heartbeat; |
126 | static unsigned long wdt_is_open; | 126 | static unsigned long wdt_is_open; |
127 | static char wdt_expect_close; | 127 | static char wdt_expect_close; |
@@ -145,8 +145,7 @@ static void wdt_timer_ping(unsigned long data) | |||
145 | spin_unlock(&wdt_spinlock); | 145 | spin_unlock(&wdt_spinlock); |
146 | 146 | ||
147 | /* Re-set the timer interval */ | 147 | /* Re-set the timer interval */ |
148 | timer.expires = jiffies + WDT_INTERVAL; | 148 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
149 | add_timer(&timer); | ||
150 | } else { | 149 | } else { |
151 | printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); | 150 | printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); |
152 | } | 151 | } |
@@ -179,8 +178,7 @@ static int wdt_startup(void) | |||
179 | next_heartbeat = jiffies + (timeout * HZ); | 178 | next_heartbeat = jiffies + (timeout * HZ); |
180 | 179 | ||
181 | /* Start the timer */ | 180 | /* Start the timer */ |
182 | timer.expires = jiffies + WDT_INTERVAL; | 181 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
183 | add_timer(&timer); | ||
184 | 182 | ||
185 | /* Start the watchdog */ | 183 | /* Start the watchdog */ |
186 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); | 184 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); |
@@ -389,10 +387,6 @@ static int __init sc520_wdt_init(void) | |||
389 | 387 | ||
390 | spin_lock_init(&wdt_spinlock); | 388 | spin_lock_init(&wdt_spinlock); |
391 | 389 | ||
392 | init_timer(&timer); | ||
393 | timer.function = wdt_timer_ping; | ||
394 | timer.data = 0; | ||
395 | |||
396 | /* Check that the timeout value is within it's range ; if not reset to the default */ | 390 | /* Check that the timeout value is within it's range ; if not reset to the default */ |
397 | if (wdt_set_heartbeat(timeout)) { | 391 | if (wdt_set_heartbeat(timeout)) { |
398 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 392 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |