fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / pci / hotplug / cpcihp_generic.c
index 141941a..f3852a6 100644 (file)
  * Send feedback to <scottm@somanetworks.com>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
+#include <linux/string.h>
 #include "cpci_hotplug.h"
 
 #define DRIVER_VERSION "0.1"
 #define DRIVER_AUTHOR  "Scott Murray <scottm@somanetworks.com>"
 #define DRIVER_DESC    "Generic port I/O CompactPCI Hot Plug Driver"
 
-#if !defined(CONFIG_HOTPLUG_CPCI_GENERIC_MODULE)
+#if !defined(MODULE)
 #define MY_NAME        "cpcihp_generic"
 #else
 #define MY_NAME        THIS_MODULE->name
@@ -63,7 +63,7 @@
 
 /* local variables */
 static int debug;
-static charbridge;
+static char *bridge;
 static u8 bridge_busnr;
 static u8 bridge_slot;
 static struct pci_bus *bus;
@@ -84,7 +84,7 @@ static int __init validate_parameters(void)
 
        if(!bridge) {
                info("not configured, disabling.");
-               return 1;
+               return -EINVAL;
        }
        str = bridge;
        if(!*str)
@@ -147,7 +147,7 @@ static int __init cpcihp_generic_init(void)
 
        info(DRIVER_DESC " version: " DRIVER_VERSION);
        status = validate_parameters();
-       if(status != 0)
+       if (status)
                return status;
 
        r = request_region(port, 1, "#ENUM hotswap signal register");
@@ -209,15 +209,15 @@ module_exit(cpcihp_generic_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
-MODULE_PARM(bridge, "s");
+module_param(bridge, charp, 0);
 MODULE_PARM_DESC(bridge, "Hotswap bus bridge device, <bus>:<slot> (bus and slot are in hexadecimal)");
-MODULE_PARM(first_slot, "b");
+module_param(first_slot, byte, 0);
 MODULE_PARM_DESC(first_slot, "Hotswap bus first slot number");
-MODULE_PARM(last_slot, "b");
+module_param(last_slot, byte, 0);
 MODULE_PARM_DESC(last_slot, "Hotswap bus last slot number");
-MODULE_PARM(port, "h");
+module_param(port, ushort, 0);
 MODULE_PARM_DESC(port, "#ENUM signal I/O port");
-MODULE_PARM(enum_bit, "i");
+module_param(enum_bit, uint, 0);
 MODULE_PARM_DESC(enum_bit, "#ENUM signal bit (0-7)");