Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

+11 -5
+11 -5
drivers/watchdog/sbc8360.c
··· 231 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 241 /* Userspace pings kernel driver, or requests clean close */ 235 242 static ssize_t sbc8360_write(struct file *file, const char __user *buf, 236 243 size_t count, loff_t *ppos) ··· 278 271 static int sbc8360_close(struct inode *inode, struct file *file) 279 272 { 280 273 if (expect_close == 42) 281 - outb(0, SBC8360_ENABLE); 274 + sbc8360_stop(); 282 275 else 283 276 printk(KERN_CRIT PFX 284 277 "SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); ··· 295 288 static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code, 296 289 void *unused) 297 290 { 298 - if (code == SYS_DOWN || code == SYS_HALT) { 299 - /* Disable the SBC8360 Watchdog */ 300 - outb(0, SBC8360_ENABLE); 301 - } 291 + if (code == SYS_DOWN || code == SYS_HALT) 292 + sbc8360_stop(); /* Disable the SBC8360 Watchdog */ 293 + 302 294 return NOTIFY_DONE; 303 295 } 304 296