diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2008-07-18 15:59:48 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-08-06 09:21:16 -0400 |
commit | 12b7a1523eda9cd72362fdda928ddb995ecdc06d (patch) | |
tree | b5f38749e148f3afb3c5afdae0c7cb4c81c8b973 /drivers/watchdog | |
parent | 0c06090c9472db0525cb6fe229c3bea33bbbbb3c (diff) |
[WATCHDOG] sbc8360.c - move stop code into a function
Move the sbc8360.c watchdog stop code into a seperate function.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/sbc8360.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c index c66fa6694fc3..fd83dd052d8c 100644 --- a/drivers/watchdog/sbc8360.c +++ b/drivers/watchdog/sbc8360.c | |||
@@ -231,6 +231,13 @@ static void sbc8360_ping(void) | |||
231 | outb(wd_margin, SBC8360_BASETIME); | 231 | outb(wd_margin, SBC8360_BASETIME); |
232 | } | 232 | } |
233 | 233 | ||
234 | /* stop watchdog */ | ||
235 | static void sbc8360_stop(void) | ||
236 | { | ||
237 | /* De-activate the watchdog */ | ||
238 | outb(0, SBC8360_ENABLE); | ||
239 | } | ||
240 | |||
234 | /* Userspace pings kernel driver, or requests clean close */ | 241 | /* Userspace pings kernel driver, or requests clean close */ |
235 | static ssize_t sbc8360_write(struct file *file, const char __user *buf, | 242 | static ssize_t sbc8360_write(struct file *file, const char __user *buf, |
236 | size_t count, loff_t *ppos) | 243 | size_t count, loff_t *ppos) |
@@ -271,7 +278,7 @@ static int sbc8360_open(struct inode *inode, struct file *file) | |||
271 | static int sbc8360_close(struct inode *inode, struct file *file) | 278 | static int sbc8360_close(struct inode *inode, struct file *file) |
272 | { | 279 | { |
273 | if (expect_close == 42) | 280 | if (expect_close == 42) |
274 | outb(0, SBC8360_ENABLE); | 281 | sbc8360_stop(); |
275 | else | 282 | else |
276 | printk(KERN_CRIT PFX | 283 | printk(KERN_CRIT PFX |
277 | "SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); | 284 | "SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); |
@@ -288,10 +295,9 @@ static int sbc8360_close(struct inode *inode, struct file *file) | |||
288 | static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code, | 295 | static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code, |
289 | void *unused) | 296 | void *unused) |
290 | { | 297 | { |
291 | if (code == SYS_DOWN || code == SYS_HALT) { | 298 | if (code == SYS_DOWN || code == SYS_HALT) |
292 | /* Disable the SBC8360 Watchdog */ | 299 | sbc8360_stop(); /* Disable the SBC8360 Watchdog */ |
293 | outb(0, SBC8360_ENABLE); | 300 | |
294 | } | ||
295 | return NOTIFY_DONE; | 301 | return NOTIFY_DONE; |
296 | } | 302 | } |
297 | 303 | ||