[S390] Add Documentation/s390/00-INDEX.
[safe/jmp/linux-2.6] / drivers / char / watchdog / sbc8360.c
index c6cbf80..285d852 100644 (file)
@@ -36,7 +36,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/miscdevice.h>
@@ -201,11 +200,11 @@ static int wd_margin = 0xB;
 static int wd_multiplier = 2;
 static int nowayout = WATCHDOG_NOWAYOUT;
 
-module_param(timeout, int, 27);
+module_param(timeout, int, 0);
 MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))");
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout,
-                "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+                "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
 /*
  *     Kernel methods.
@@ -306,7 +305,7 @@ static int sbc8360_notify_sys(struct notifier_block *this, unsigned long code,
  *     Kernel Interfaces
  */
 
-static struct file_operations sbc8360_fops = {
+static const struct file_operations sbc8360_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = sbc8360_write,
@@ -334,18 +333,17 @@ static int __init sbc8360_init(void)
        int res;
        unsigned long int mseconds = 60000;
 
-       spin_lock_init(&sbc8360_lock);
-       res = misc_register(&sbc8360_miscdev);
-       if (res) {
-               printk(KERN_ERR PFX "failed to register misc device\n");
-               goto out_nomisc;
+       if (timeout < 0 || timeout > 63) {
+               printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n");
+               res = -EINVAL;
+               goto out;
        }
 
        if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) {
                printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n",
                       SBC8360_ENABLE);
                res = -EIO;
-               goto out_noenablereg;
+               goto out;
        }
        if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) {
                printk(KERN_ERR PFX
@@ -361,10 +359,11 @@ static int __init sbc8360_init(void)
                goto out_noreboot;
        }
 
-       if (timeout < 0 || timeout > 63) {
-               printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n");
-               res = -EINVAL;
-               goto out_noreboot;
+       spin_lock_init(&sbc8360_lock);
+       res = misc_register(&sbc8360_miscdev);
+       if (res) {
+               printk(KERN_ERR PFX "failed to register misc device\n");
+               goto out_nomisc;
        }
 
        wd_margin = wd_times[timeout][0];
@@ -384,13 +383,13 @@ static int __init sbc8360_init(void)
 
        return 0;
 
+      out_nomisc:
+       unregister_reboot_notifier(&sbc8360_notifier);
       out_noreboot:
-       release_region(SBC8360_ENABLE, 1);
        release_region(SBC8360_BASETIME, 1);
-      out_noenablereg:
       out_nobasetimereg:
-       misc_deregister(&sbc8360_miscdev);
-      out_nomisc:
+       release_region(SBC8360_ENABLE, 1);
+      out:
        return res;
 }
 
@@ -408,7 +407,7 @@ module_exit(sbc8360_exit);
 MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>");
 MODULE_DESCRIPTION("SBC8360 watchdog driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION("1.0");
+MODULE_VERSION("1.01");
 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
 
 /* end of sbc8360.c */