Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[sfrench/cifs-2.6.git] / drivers / char / watchdog / sc1200wdt.c
index 78ef6333c181472325fad4d30de6babbf844f8c0..2f7ba7a514fe08616e71fc85a7eebb04a7523510 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/init.h>
 #include <linux/pnp.h>
 #include <linux/fs.h>
-#include <linux/pci.h>
 
 #include <asm/semaphore.h>
 #include <asm/io.h>
@@ -92,7 +91,7 @@ MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
 
 static int nowayout = WATCHDOG_NOWAYOUT;
 module_param(nowayout, int, 0);
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 
 
@@ -180,7 +179,7 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int
 
        switch (cmd) {
                default:
-                       return -ENOIOCTLCMD;    /* Keep Pavel Machek amused ;) */
+                       return -ENOTTY;
 
                case WDIOC_GETSUPPORT:
                        if (copy_to_user(argp, &ident, sizeof ident))
@@ -292,7 +291,7 @@ static struct notifier_block sc1200wdt_notifier =
        .notifier_call =        sc1200wdt_notify_sys,
 };
 
-static struct file_operations sc1200wdt_fops =
+static const struct file_operations sc1200wdt_fops =
 {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
@@ -392,7 +391,7 @@ static int __init sc1200wdt_init(void)
        if (io == -1) {
                printk(KERN_ERR PFX "io parameter must be specified\n");
                ret = -EINVAL;
-               goto out_clean;
+               goto out_pnp;
        }
 
 #if defined CONFIG_PNP
@@ -405,7 +404,7 @@ static int __init sc1200wdt_init(void)
        if (!request_region(io, io_len, SC1200_MODULE_NAME)) {
                printk(KERN_ERR PFX "Unable to register IO port %#x\n", io);
                ret = -EBUSY;
-               goto out_clean;
+               goto out_pnp;
        }
 
        ret = sc1200wdt_probe();
@@ -435,6 +434,11 @@ out_rbt:
 out_io:
        release_region(io, io_len);
 
+out_pnp:
+#if defined CONFIG_PNP
+       if (isapnp)
+               pnp_unregister_driver(&scl200wdt_pnp_driver);
+#endif
        goto out_clean;
 }