Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[sfrench/cifs-2.6.git] / drivers / char / watchdog / s3c2410_wdt.c
index 1ea04e9b2b0b0938cfc2cbfa04b2eed12b4da01b..b36a04ae9ab8e96306a35ce07680aed56bae40d2 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/timer.h>
 #include <linux/miscdevice.h>
@@ -63,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;
@@ -214,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();
@@ -231,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 {
@@ -289,7 +288,7 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file,
 
        switch (cmd) {
                default:
-                       return -ENOIOCTLCMD;
+                       return -ENOTTY;
 
                case WDIOC_GETSUPPORT:
                        return copy_to_user(argp, &s3c2410_wdt_ident,
@@ -320,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,