X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fs3c2410_wdt.c;h=a49f1f2ffa22a17003ac9055498efd257e26f909;hb=25ff3780d4cd46804e22192a728cfb6b33c84d1b;hp=f267dad26071917efd3bdacb1ddf8c409d4110d7;hpb=9262e9149f346a5443300f8c451b8e7631e81a42;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index f267dad2607..a49f1f2ffa2 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c @@ -62,7 +62,7 @@ #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) -static int nowayout = WATCHDOG_NOWAYOUT; +static int nowayout = WATCHDOG_NOWAYOUT; static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; static int soft_noboot = 0; @@ -213,11 +213,10 @@ static int s3c2410wdt_open(struct inode *inode, struct file *file) if(down_trylock(&open_lock)) return -EBUSY; - if (nowayout) { + if (nowayout) __module_get(THIS_MODULE); - } else { - allow_close = CLOSE_STATE_ALLOW; - } + + allow_close = CLOSE_STATE_NOT; /* start the timer */ s3c2410wdt_start(); @@ -230,6 +229,7 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file) * Shut off the timer. * Lock it in if it's a module and we set nowayout */ + if (allow_close == CLOSE_STATE_ALLOW) { s3c2410wdt_stop(); } else { @@ -319,7 +319,7 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file, /* kernel interface */ -static struct file_operations s3c2410wdt_fops = { +static const struct file_operations s3c2410wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = s3c2410wdt_write,