Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / char / watchdog / mixcomwd.c
index 2790f9c..d8dede5 100644 (file)
@@ -45,6 +45,8 @@
 #include <linux/fs.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -59,15 +61,10 @@ static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
 
 static int watchdog_port;
 static int mixcomwd_timer_alive;
-static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0);
+static DEFINE_TIMER(mixcomwd_timer, NULL, 0, 0);
 static char expect_close;
 
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int nowayout = 1;
-#else
-static int nowayout = 0;
-#endif
-
+static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
@@ -108,7 +105,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file)
                        mixcomwd_timer_alive=0;
                }
        }
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 static int mixcomwd_release(struct inode *inode, struct file *file)
@@ -136,10 +133,6 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
 
 static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
 {
-       if (ppos != &file->f_pos) {
-               return -ESPIPE;
-       }
-
        if(len)
        {
                if (!nowayout) {
@@ -201,6 +194,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
 static struct file_operations mixcomwd_fops=
 {
        .owner          = THIS_MODULE,
+       .llseek         = no_llseek,
        .write          = mixcomwd_write,
        .ioctl          = mixcomwd_ioctl,
        .open           = mixcomwd_open,