fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / char / watchdog / alim1535_wdt.c
index 35dcbf8..01b0d13 100644 (file)
@@ -38,12 +38,7 @@ static int timeout = WATCHDOG_TIMEOUT;
 module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
 
-#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)");
 
@@ -241,7 +236,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
                        return put_user(timeout, p);
 
                default:
-                       return -ENOIOCTLCMD;
+                       return -ENOTTY;
        }
 }
 
@@ -317,7 +312,7 @@ static int ali_notify_sys(struct notifier_block *this, unsigned long code, void
  */
 
 static struct pci_device_id ali_pci_tbl[] = {
-       { PCI_VENDOR_ID_AL, 1535, PCI_ANY_ID, PCI_ANY_ID,},
+       { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,},
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, ali_pci_tbl);
@@ -335,17 +330,20 @@ static int __init ali_find_watchdog(void)
        u32 wdog;
 
        /* Check for a 1535 series bridge */
-       pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
+       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
        if(pdev == NULL)
                return -ENODEV;
+       pci_dev_put(pdev);
 
        /* Check for the a 7101 PMU */
-       pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
+       pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
        if(pdev == NULL)
                return -ENODEV;
 
-       if(pci_enable_device(pdev))
+       if(pci_enable_device(pdev)) {
+               pci_dev_put(pdev);
                return -EIO;
+       }
 
        ali_pci = pdev;
 
@@ -367,7 +365,7 @@ static int __init ali_find_watchdog(void)
  *     Kernel Interfaces
  */
 
-static struct file_operations ali_fops = {
+static const struct file_operations ali_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        ali_write,
@@ -452,6 +450,7 @@ static void __exit watchdog_exit(void)
        /* Deregister */
        unregister_reboot_notifier(&ali_notifier);
        misc_deregister(&ali_miscdev);
+       pci_dev_put(ali_pci);
 }
 
 module_init(watchdog_init);