Loading drivers/watchdog/sbc8360.c +12 −18 Original line number Diff line number Diff line Loading @@ -48,13 +48,12 @@ #include <linux/init.h> #include <linux/spinlock.h> #include <linux/moduleparam.h> #include <linux/io.h> #include <linux/uaccess.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/system.h> static unsigned long sbc8360_is_open; static DEFINE_SPINLOCK(sbc8360_lock); static char expect_close; #define PFX "sbc8360: " Loading Loading @@ -204,7 +203,8 @@ module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); /* * Kernel methods. Loading Loading @@ -257,16 +257,12 @@ static ssize_t sbc8360_write(struct file *file, const char __user * buf, static int sbc8360_open(struct inode *inode, struct file *file) { spin_lock(&sbc8360_lock); if (test_and_set_bit(0, &sbc8360_is_open)) { spin_unlock(&sbc8360_lock); if (test_and_set_bit(0, &sbc8360_is_open)) return -EBUSY; } if (nowayout) __module_get(THIS_MODULE); /* Activate and ping once to start the countdown */ spin_unlock(&sbc8360_lock); sbc8360_activate(); sbc8360_ping(); return nonseekable_open(inode, file); Loading @@ -274,7 +270,6 @@ static int sbc8360_open(struct inode *inode, struct file *file) static int sbc8360_close(struct inode *inode, struct file *file) { spin_lock(&sbc8360_lock); if (expect_close == 42) outb(0, SBC8360_ENABLE); else Loading @@ -283,7 +278,6 @@ static int sbc8360_close(struct inode *inode, struct file *file) clear_bit(0, &sbc8360_is_open); expect_close = 0; spin_unlock(&sbc8360_lock); return 0; } Loading Loading
drivers/watchdog/sbc8360.c +12 −18 Original line number Diff line number Diff line Loading @@ -48,13 +48,12 @@ #include <linux/init.h> #include <linux/spinlock.h> #include <linux/moduleparam.h> #include <linux/io.h> #include <linux/uaccess.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/system.h> static unsigned long sbc8360_is_open; static DEFINE_SPINLOCK(sbc8360_lock); static char expect_close; #define PFX "sbc8360: " Loading Loading @@ -204,7 +203,8 @@ module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); /* * Kernel methods. Loading Loading @@ -257,16 +257,12 @@ static ssize_t sbc8360_write(struct file *file, const char __user * buf, static int sbc8360_open(struct inode *inode, struct file *file) { spin_lock(&sbc8360_lock); if (test_and_set_bit(0, &sbc8360_is_open)) { spin_unlock(&sbc8360_lock); if (test_and_set_bit(0, &sbc8360_is_open)) return -EBUSY; } if (nowayout) __module_get(THIS_MODULE); /* Activate and ping once to start the countdown */ spin_unlock(&sbc8360_lock); sbc8360_activate(); sbc8360_ping(); return nonseekable_open(inode, file); Loading @@ -274,7 +270,6 @@ static int sbc8360_open(struct inode *inode, struct file *file) static int sbc8360_close(struct inode *inode, struct file *file) { spin_lock(&sbc8360_lock); if (expect_close == 42) outb(0, SBC8360_ENABLE); else Loading @@ -283,7 +278,6 @@ static int sbc8360_close(struct inode *inode, struct file *file) clear_bit(0, &sbc8360_is_open); expect_close = 0; spin_unlock(&sbc8360_lock); return 0; } Loading