Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / char / watchdog / ixp2000_wdt.c
index ab659d3..0cfb9b9 100644 (file)
 #include <asm/hardware.h>
 #include <asm/uaccess.h>
 
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-static int nowayout = 1;
-#else
-static int nowayout = 0;
-#endif
+static int nowayout = WATCHDOG_NOWAYOUT;
 static unsigned int heartbeat = 60;    /* (secs) Default is 1 minute */
 static unsigned long wdt_status;
 
@@ -162,7 +158,7 @@ ixp2000_wdt_release(struct inode *inode, struct file *file)
        if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) {
                wdt_disable();
        } else {
-               printk(KERN_CRIT "WATCHDOG: Device closed unexpectdly - "
+               printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
                                        "timer will not stop\n");
        }
 
@@ -186,13 +182,18 @@ static struct file_operations ixp2000_wdt_fops =
 static struct miscdevice ixp2000_wdt_miscdev =
 {
        .minor          = WATCHDOG_MINOR,
-       .name           = "IXP2000 Watchdog",
+       .name           = "watchdog",
        .fops           = &ixp2000_wdt_fops,
 };
 
 static int __init ixp2000_wdt_init(void)
 {
-       wdt_tick_rate = (*IXP2000_T1_CLD * HZ)/ 256;;
+       if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) {
+               printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n");
+               return -EIO;
+       }
+
+       wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256;
 
        return misc_register(&ixp2000_wdt_miscdev);
 }