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 / wdt_pci.c
index c63d17f..4b33119 100644 (file)
@@ -89,12 +89,7 @@ static int wd_heartbeat;
 module_param(heartbeat, int, 0);
 MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")");
 
-#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)");
 
@@ -311,7 +306,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                printk(KERN_CRIT PFX "Would Reboot.\n");
 #else
                printk(KERN_CRIT PFX "Initiating system reboot.\n");
-               machine_restart(NULL);
+               emergency_restart(NULL);
 #endif
 #else
                printk(KERN_CRIT PFX "Reset in 5ms.\n");
@@ -333,10 +328,6 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-       /*  Can't seek (pwrite) on this device  */
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
-
        if (count) {
                if (!nowayout) {
                        size_t i;
@@ -446,7 +437,7 @@ static int wdtpci_open(struct inode *inode, struct file *file)
         *      Activate
         */
        wdtpci_start();
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 /**
@@ -490,10 +481,6 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun
 {
        int temperature;
 
-       /*  Can't seek (pread) on this device  */
-       if (ptr != &file->f_pos)
-               return -ESPIPE;
-
        if (wdtpci_get_temperature(&temperature))
                return -EFAULT;
 
@@ -513,7 +500,7 @@ static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t coun
 
 static int wdtpci_temp_open(struct inode *inode, struct file *file)
 {
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 /**
@@ -682,8 +669,8 @@ out:
 out_misc:
 #ifdef CONFIG_WDT_501_PCI
        misc_deregister(&temp_miscdev);
-#endif /* CONFIG_WDT_501_PCI */
 out_rbt:
+#endif /* CONFIG_WDT_501_PCI */
        unregister_reboot_notifier(&wdtpci_notifier);
 out_irq:
        free_irq(irq, &wdtpci_miscdev);