vserver 1.9.5.x5
[linux-2.6.git] / drivers / input / joystick / magellan.c
index 992511d..42b0886 100644 (file)
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  *  Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
 #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;
@@ -159,7 +161,7 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
 
        memset(magellan, 0, sizeof(struct magellan));
 
-       magellan->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);     
+       magellan->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
 
        for (i = 0; i < 9; i++)
                set_bit(magellan_buttons[i], magellan->dev.keybit);
@@ -181,10 +183,11 @@ static void magellan_connect(struct serio *serio, struct serio_dev *dev)
        magellan->dev.id.vendor = SERIO_MAGELLAN;
        magellan->dev.id.product = 0x0001;
        magellan->dev.id.version = 0x0100;
-       
+       magellan->dev.dev = &serio->dev;
+
        serio->private = magellan;
 
-       if (serio_open(serio, dev)) {
+       if (serio_open(serio, drv)) {
                kfree(magellan);
                return;
        }
@@ -199,10 +202,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 +218,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);