vserver 1.9.3
[linux-2.6.git] / drivers / input / joystick / magellan.c
index f326299..2b303ba 100644 (file)
 #include <linux/serio.h>
 #include <linux/init.h>
 
+#define DRIVER_DESC    "Magellan and SpaceMouse 6dof controller driver"
+
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("Magellan and SpaceMouse 6dof controller driver");
+MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
 /*
@@ -146,7 +148,7 @@ static void magellan_disconnect(struct serio *serio)
  * it as an input device.
  */
 
-static void magellan_connect(struct serio *serio, struct serio_dev *dev)
+static void magellan_connect(struct serio *serio, struct serio_driver *drv)
 {
        struct magellan *magellan;
        int i, t;
@@ -184,7 +186,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
 
        serio->private = magellan;
 
-       if (serio_open(serio, dev)) {
+       if (serio_open(serio, drv)) {
                kfree(magellan);
                return;
        }
@@ -199,10 +201,14 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
  * The serio device structure.
  */
 
-static struct serio_dev magellan_dev = {
-       .interrupt =    magellan_interrupt,
-       .connect =      magellan_connect,
-       .disconnect =   magellan_disconnect,
+static struct serio_driver magellan_drv = {
+       .driver         = {
+               .name   = "magellan",
+       },
+       .description    = DRIVER_DESC,
+       .interrupt      = magellan_interrupt,
+       .connect        = magellan_connect,
+       .disconnect     = magellan_disconnect,
 };
 
 /*
@@ -211,13 +217,13 @@ static struct serio_dev magellan_dev = {
 
 int __init magellan_init(void)
 {
-       serio_register_device(&magellan_dev);
+       serio_register_driver(&magellan_drv);
        return 0;
 }
 
 void __exit magellan_exit(void)
 {
-       serio_unregister_device(&magellan_dev);
+       serio_unregister_driver(&magellan_drv);
 }
 
 module_init(magellan_init);