diff options
Diffstat (limited to 'drivers/input/joystick/db9.c')
-rw-r--r-- | drivers/input/joystick/db9.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index b41bd2eb37d..86ad1027e12 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -46,17 +46,17 @@ MODULE_LICENSE("GPL"); struct db9_config { int args[2]; - int nargs; + unsigned int nargs; }; #define DB9_MAX_PORTS 3 -static struct db9_config db9[DB9_MAX_PORTS] __initdata; +static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata; -module_param_array_named(dev, db9[0].args, int, &db9[0].nargs, 0); +module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0); MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)"); -module_param_array_named(dev2, db9[1].args, int, &db9[0].nargs, 0); +module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0); MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)"); -module_param_array_named(dev3, db9[2].args, int, &db9[2].nargs, 0); +module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0); MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); #define DB9_ARG_PARPORT 0 @@ -518,7 +518,7 @@ static void db9_timer(unsigned long private) static int db9_open(struct input_dev *dev) { - struct db9 *db9 = dev->private; + struct db9 *db9 = input_get_drvdata(dev); struct parport *port = db9->pd->port; int err; @@ -542,7 +542,7 @@ static int db9_open(struct input_dev *dev) static void db9_close(struct input_dev *dev) { - struct db9 *db9 = dev->private; + struct db9 *db9 = input_get_drvdata(dev); struct parport *port = db9->pd->port; mutex_lock(&db9->mutex); @@ -625,7 +625,8 @@ static struct db9 __init *db9_probe(int parport, int mode) input_dev->id.vendor = 0x0002; input_dev->id.product = mode; input_dev->id.version = 0x0100; - input_dev->private = db9; + + input_set_drvdata(input_dev, db9); input_dev->open = db9_open; input_dev->close = db9_close; @@ -679,17 +680,17 @@ static int __init db9_init(void) int err = 0; for (i = 0; i < DB9_MAX_PORTS; i++) { - if (db9[i].nargs == 0 || db9[i].args[DB9_ARG_PARPORT] < 0) + if (db9_cfg[i].nargs == 0 || db9_cfg[i].args[DB9_ARG_PARPORT] < 0) continue; - if (db9[i].nargs < 2) { + if (db9_cfg[i].nargs < 2) { printk(KERN_ERR "db9.c: Device type must be specified.\n"); err = -EINVAL; break; } - db9_base[i] = db9_probe(db9[i].args[DB9_ARG_PARPORT], - db9[i].args[DB9_ARG_MODE]); + db9_base[i] = db9_probe(db9_cfg[i].args[DB9_ARG_PARPORT], + db9_cfg[i].args[DB9_ARG_MODE]); if (IS_ERR(db9_base[i])) { err = PTR_ERR(db9_base[i]); break; |