aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r--drivers/input/joystick/a3d.c9
-rw-r--r--drivers/input/joystick/adi.c9
-rw-r--r--drivers/input/joystick/analog.c9
-rw-r--r--drivers/input/joystick/cobra.c9
-rw-r--r--drivers/input/joystick/db9.c7
-rw-r--r--drivers/input/joystick/gamecon.c7
-rw-r--r--drivers/input/joystick/gf2k.c10
-rw-r--r--drivers/input/joystick/grip.c9
-rw-r--r--drivers/input/joystick/grip_mp.c11
-rw-r--r--drivers/input/joystick/guillemot.c9
-rw-r--r--drivers/input/joystick/iforce/iforce-ff.c10
-rw-r--r--drivers/input/joystick/iforce/iforce-main.c26
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c22
-rw-r--r--drivers/input/joystick/iforce/iforce-serio.c2
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c13
-rw-r--r--drivers/input/joystick/iforce/iforce.h2
-rw-r--r--drivers/input/joystick/interact.c8
-rw-r--r--drivers/input/joystick/magellan.c3
-rw-r--r--drivers/input/joystick/sidewinder.c9
-rw-r--r--drivers/input/joystick/spaceball.c3
-rw-r--r--drivers/input/joystick/spaceorb.c3
-rw-r--r--drivers/input/joystick/stinger.c3
-rw-r--r--drivers/input/joystick/tmdc.c9
-rw-r--r--drivers/input/joystick/turbografx.c7
-rw-r--r--drivers/input/joystick/twidjoy.c4
-rw-r--r--drivers/input/joystick/warrior.c3
26 files changed, 111 insertions, 105 deletions
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
index b11a4bbc84c4..ff701ab10d74 100644
--- a/drivers/input/joystick/a3d.c
+++ b/drivers/input/joystick/a3d.c
@@ -241,7 +241,7 @@ static void a3d_adc_close(struct gameport *gameport)
241 241
242static int a3d_open(struct input_dev *dev) 242static int a3d_open(struct input_dev *dev)
243{ 243{
244 struct a3d *a3d = dev->private; 244 struct a3d *a3d = input_get_drvdata(dev);
245 245
246 gameport_start_polling(a3d->gameport); 246 gameport_start_polling(a3d->gameport);
247 return 0; 247 return 0;
@@ -253,7 +253,7 @@ static int a3d_open(struct input_dev *dev)
253 253
254static void a3d_close(struct input_dev *dev) 254static void a3d_close(struct input_dev *dev)
255{ 255{
256 struct a3d *a3d = dev->private; 256 struct a3d *a3d = input_get_drvdata(dev);
257 257
258 gameport_stop_polling(a3d->gameport); 258 gameport_stop_polling(a3d->gameport);
259} 259}
@@ -314,11 +314,12 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)
314 input_dev->id.vendor = GAMEPORT_ID_VENDOR_MADCATZ; 314 input_dev->id.vendor = GAMEPORT_ID_VENDOR_MADCATZ;
315 input_dev->id.product = a3d->mode; 315 input_dev->id.product = a3d->mode;
316 input_dev->id.version = 0x0100; 316 input_dev->id.version = 0x0100;
317 input_dev->cdev.dev = &gameport->dev; 317 input_dev->dev.parent = &gameport->dev;
318 input_dev->private = a3d;
319 input_dev->open = a3d_open; 318 input_dev->open = a3d_open;
320 input_dev->close = a3d_close; 319 input_dev->close = a3d_close;
321 320
321 input_set_drvdata(input_dev, a3d);
322
322 if (a3d->mode == A3D_MODE_PXL) { 323 if (a3d->mode == A3D_MODE_PXL) {
323 324
324 int axes[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER }; 325 int axes[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER };
diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
index 6279ced8a35b..28140c4a110d 100644
--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -290,7 +290,7 @@ static void adi_poll(struct gameport *gameport)
290 290
291static int adi_open(struct input_dev *dev) 291static int adi_open(struct input_dev *dev)
292{ 292{
293 struct adi_port *port = dev->private; 293 struct adi_port *port = input_get_drvdata(dev);
294 294
295 gameport_start_polling(port->gameport); 295 gameport_start_polling(port->gameport);
296 return 0; 296 return 0;
@@ -302,7 +302,7 @@ static int adi_open(struct input_dev *dev)
302 302
303static void adi_close(struct input_dev *dev) 303static void adi_close(struct input_dev *dev)
304{ 304{
305 struct adi_port *port = dev->private; 305 struct adi_port *port = input_get_drvdata(dev);
306 306
307 gameport_stop_polling(port->gameport); 307 gameport_stop_polling(port->gameport);
308} 308}
@@ -424,8 +424,9 @@ static int adi_init_input(struct adi *adi, struct adi_port *port, int half)
424 input_dev->id.vendor = GAMEPORT_ID_VENDOR_LOGITECH; 424 input_dev->id.vendor = GAMEPORT_ID_VENDOR_LOGITECH;
425 input_dev->id.product = adi->id; 425 input_dev->id.product = adi->id;
426 input_dev->id.version = 0x0100; 426 input_dev->id.version = 0x0100;
427 input_dev->cdev.dev = &port->gameport->dev; 427 input_dev->dev.parent = &port->gameport->dev;
428 input_dev->private = port; 428
429 input_set_drvdata(input_dev, port);
429 430
430 input_dev->open = adi_open; 431 input_dev->open = adi_open;
431 input_dev->close = adi_close; 432 input_dev->close = adi_close;
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 51f1e4bfff3e..1c1afb5d4684 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -343,7 +343,7 @@ static void analog_poll(struct gameport *gameport)
343 343
344static int analog_open(struct input_dev *dev) 344static int analog_open(struct input_dev *dev)
345{ 345{
346 struct analog_port *port = dev->private; 346 struct analog_port *port = input_get_drvdata(dev);
347 347
348 gameport_start_polling(port->gameport); 348 gameport_start_polling(port->gameport);
349 return 0; 349 return 0;
@@ -355,7 +355,7 @@ static int analog_open(struct input_dev *dev)
355 355
356static void analog_close(struct input_dev *dev) 356static void analog_close(struct input_dev *dev)
357{ 357{
358 struct analog_port *port = dev->private; 358 struct analog_port *port = input_get_drvdata(dev);
359 359
360 gameport_stop_polling(port->gameport); 360 gameport_stop_polling(port->gameport);
361} 361}
@@ -449,10 +449,13 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i
449 input_dev->id.vendor = GAMEPORT_ID_VENDOR_ANALOG; 449 input_dev->id.vendor = GAMEPORT_ID_VENDOR_ANALOG;
450 input_dev->id.product = analog->mask >> 4; 450 input_dev->id.product = analog->mask >> 4;
451 input_dev->id.version = 0x0100; 451 input_dev->id.version = 0x0100;
452 input_dev->dev.parent = &port->gameport->dev;
453
454 input_set_drvdata(input_dev, port);
452 455
453 input_dev->open = analog_open; 456 input_dev->open = analog_open;
454 input_dev->close = analog_close; 457 input_dev->close = analog_close;
455 input_dev->private = port; 458
456 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 459 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
457 460
458 for (i = j = 0; i < 4; i++) 461 for (i = j = 0; i < 4; i++)
diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c
index 034ec39c251d..d3352a849b85 100644
--- a/drivers/input/joystick/cobra.c
+++ b/drivers/input/joystick/cobra.c
@@ -142,7 +142,7 @@ static void cobra_poll(struct gameport *gameport)
142 142
143static int cobra_open(struct input_dev *dev) 143static int cobra_open(struct input_dev *dev)
144{ 144{
145 struct cobra *cobra = dev->private; 145 struct cobra *cobra = input_get_drvdata(dev);
146 146
147 gameport_start_polling(cobra->gameport); 147 gameport_start_polling(cobra->gameport);
148 return 0; 148 return 0;
@@ -150,7 +150,7 @@ static int cobra_open(struct input_dev *dev)
150 150
151static void cobra_close(struct input_dev *dev) 151static void cobra_close(struct input_dev *dev)
152{ 152{
153 struct cobra *cobra = dev->private; 153 struct cobra *cobra = input_get_drvdata(dev);
154 154
155 gameport_stop_polling(cobra->gameport); 155 gameport_stop_polling(cobra->gameport);
156} 156}
@@ -211,8 +211,9 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
211 input_dev->id.vendor = GAMEPORT_ID_VENDOR_CREATIVE; 211 input_dev->id.vendor = GAMEPORT_ID_VENDOR_CREATIVE;
212 input_dev->id.product = 0x0008; 212 input_dev->id.product = 0x0008;
213 input_dev->id.version = 0x0100; 213 input_dev->id.version = 0x0100;
214 input_dev->cdev.dev = &gameport->dev; 214 input_dev->dev.parent = &gameport->dev;
215 input_dev->private = cobra; 215
216 input_set_drvdata(input_dev, cobra);
216 217
217 input_dev->open = cobra_open; 218 input_dev->open = cobra_open;
218 input_dev->close = cobra_close; 219 input_dev->close = cobra_close;
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index b41bd2eb37dd..c27593bf9978 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -518,7 +518,7 @@ static void db9_timer(unsigned long private)
518 518
519static int db9_open(struct input_dev *dev) 519static int db9_open(struct input_dev *dev)
520{ 520{
521 struct db9 *db9 = dev->private; 521 struct db9 *db9 = input_get_drvdata(dev);
522 struct parport *port = db9->pd->port; 522 struct parport *port = db9->pd->port;
523 int err; 523 int err;
524 524
@@ -542,7 +542,7 @@ static int db9_open(struct input_dev *dev)
542 542
543static void db9_close(struct input_dev *dev) 543static void db9_close(struct input_dev *dev)
544{ 544{
545 struct db9 *db9 = dev->private; 545 struct db9 *db9 = input_get_drvdata(dev);
546 struct parport *port = db9->pd->port; 546 struct parport *port = db9->pd->port;
547 547
548 mutex_lock(&db9->mutex); 548 mutex_lock(&db9->mutex);
@@ -625,7 +625,8 @@ static struct db9 __init *db9_probe(int parport, int mode)
625 input_dev->id.vendor = 0x0002; 625 input_dev->id.vendor = 0x0002;
626 input_dev->id.product = mode; 626 input_dev->id.product = mode;
627 input_dev->id.version = 0x0100; 627 input_dev->id.version = 0x0100;
628 input_dev->private = db9; 628
629 input_set_drvdata(input_dev, db9);
629 630
630 input_dev->open = db9_open; 631 input_dev->open = db9_open;
631 input_dev->close = db9_close; 632 input_dev->close = db9_close;
diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
index 711e4b3e9e61..c71b58fe225d 100644
--- a/drivers/input/joystick/gamecon.c
+++ b/drivers/input/joystick/gamecon.c
@@ -591,7 +591,7 @@ static void gc_timer(unsigned long private)
591 591
592static int gc_open(struct input_dev *dev) 592static int gc_open(struct input_dev *dev)
593{ 593{
594 struct gc *gc = dev->private; 594 struct gc *gc = input_get_drvdata(dev);
595 int err; 595 int err;
596 596
597 err = mutex_lock_interruptible(&gc->mutex); 597 err = mutex_lock_interruptible(&gc->mutex);
@@ -610,7 +610,7 @@ static int gc_open(struct input_dev *dev)
610 610
611static void gc_close(struct input_dev *dev) 611static void gc_close(struct input_dev *dev)
612{ 612{
613 struct gc *gc = dev->private; 613 struct gc *gc = input_get_drvdata(dev);
614 614
615 mutex_lock(&gc->mutex); 615 mutex_lock(&gc->mutex);
616 if (!--gc->used) { 616 if (!--gc->used) {
@@ -646,7 +646,8 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
646 input_dev->id.vendor = 0x0001; 646 input_dev->id.vendor = 0x0001;
647 input_dev->id.product = pad_type; 647 input_dev->id.product = pad_type;
648 input_dev->id.version = 0x0100; 648 input_dev->id.version = 0x0100;
649 input_dev->private = gc; 649
650 input_set_drvdata(input_dev, gc);
650 651
651 input_dev->open = gc_open; 652 input_dev->open = gc_open;
652 input_dev->close = gc_close; 653 input_dev->close = gc_close;
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
index bacbab5d1b6f..d514aebf7554 100644
--- a/drivers/input/joystick/gf2k.c
+++ b/drivers/input/joystick/gf2k.c
@@ -220,7 +220,7 @@ static void gf2k_poll(struct gameport *gameport)
220 220
221static int gf2k_open(struct input_dev *dev) 221static int gf2k_open(struct input_dev *dev)
222{ 222{
223 struct gf2k *gf2k = dev->private; 223 struct gf2k *gf2k = input_get_drvdata(dev);
224 224
225 gameport_start_polling(gf2k->gameport); 225 gameport_start_polling(gf2k->gameport);
226 return 0; 226 return 0;
@@ -228,7 +228,7 @@ static int gf2k_open(struct input_dev *dev)
228 228
229static void gf2k_close(struct input_dev *dev) 229static void gf2k_close(struct input_dev *dev)
230{ 230{
231 struct gf2k *gf2k = dev->private; 231 struct gf2k *gf2k = input_get_drvdata(dev);
232 232
233 gameport_stop_polling(gf2k->gameport); 233 gameport_stop_polling(gf2k->gameport);
234} 234}
@@ -308,11 +308,13 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)
308 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GENIUS; 308 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GENIUS;
309 input_dev->id.product = gf2k->id; 309 input_dev->id.product = gf2k->id;
310 input_dev->id.version = 0x0100; 310 input_dev->id.version = 0x0100;
311 input_dev->cdev.dev = &gameport->dev; 311 input_dev->dev.parent = &gameport->dev;
312 input_dev->private = gf2k; 312
313 input_set_drvdata(input_dev, gf2k);
313 314
314 input_dev->open = gf2k_open; 315 input_dev->open = gf2k_open;
315 input_dev->close = gf2k_close; 316 input_dev->close = gf2k_close;
317
316 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 318 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
317 319
318 for (i = 0; i < gf2k_axes[gf2k->id]; i++) 320 for (i = 0; i < gf2k_axes[gf2k->id]; i++)
diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
index 17a90c436de8..73eb5ab6f140 100644
--- a/drivers/input/joystick/grip.c
+++ b/drivers/input/joystick/grip.c
@@ -285,7 +285,7 @@ static void grip_poll(struct gameport *gameport)
285 285
286static int grip_open(struct input_dev *dev) 286static int grip_open(struct input_dev *dev)
287{ 287{
288 struct grip *grip = dev->private; 288 struct grip *grip = input_get_drvdata(dev);
289 289
290 gameport_start_polling(grip->gameport); 290 gameport_start_polling(grip->gameport);
291 return 0; 291 return 0;
@@ -293,7 +293,7 @@ static int grip_open(struct input_dev *dev)
293 293
294static void grip_close(struct input_dev *dev) 294static void grip_close(struct input_dev *dev)
295{ 295{
296 struct grip *grip = dev->private; 296 struct grip *grip = input_get_drvdata(dev);
297 297
298 gameport_stop_polling(grip->gameport); 298 gameport_stop_polling(grip->gameport);
299} 299}
@@ -363,8 +363,9 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
363 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS; 363 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;
364 input_dev->id.product = grip->mode[i]; 364 input_dev->id.product = grip->mode[i];
365 input_dev->id.version = 0x0100; 365 input_dev->id.version = 0x0100;
366 input_dev->cdev.dev = &gameport->dev; 366 input_dev->dev.parent = &gameport->dev;
367 input_dev->private = grip; 367
368 input_set_drvdata(input_dev, grip);
368 369
369 input_dev->open = grip_open; 370 input_dev->open = grip_open;
370 input_dev->close = grip_close; 371 input_dev->close = grip_close;
diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
index 8120a9c40773..555319e6378c 100644
--- a/drivers/input/joystick/grip_mp.c
+++ b/drivers/input/joystick/grip_mp.c
@@ -562,7 +562,7 @@ static void grip_poll(struct gameport *gameport)
562 562
563static int grip_open(struct input_dev *dev) 563static int grip_open(struct input_dev *dev)
564{ 564{
565 struct grip_mp *grip = dev->private; 565 struct grip_mp *grip = input_get_drvdata(dev);
566 566
567 gameport_start_polling(grip->gameport); 567 gameport_start_polling(grip->gameport);
568 return 0; 568 return 0;
@@ -574,9 +574,9 @@ static int grip_open(struct input_dev *dev)
574 574
575static void grip_close(struct input_dev *dev) 575static void grip_close(struct input_dev *dev)
576{ 576{
577 struct grip_mp *grip = dev->private; 577 struct grip_mp *grip = input_get_drvdata(dev);
578 578
579 gameport_start_polling(grip->gameport); 579 gameport_stop_polling(grip->gameport);
580} 580}
581 581
582/* 582/*
@@ -599,8 +599,9 @@ static int register_slot(int slot, struct grip_mp *grip)
599 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS; 599 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;
600 input_dev->id.product = 0x0100 + port->mode; 600 input_dev->id.product = 0x0100 + port->mode;
601 input_dev->id.version = 0x0100; 601 input_dev->id.version = 0x0100;
602 input_dev->cdev.dev = &grip->gameport->dev; 602 input_dev->dev.parent = &grip->gameport->dev;
603 input_dev->private = grip; 603
604 input_set_drvdata(input_dev, grip);
604 605
605 input_dev->open = grip_open; 606 input_dev->open = grip_open;
606 input_dev->close = grip_close; 607 input_dev->close = grip_close;
diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c
index dbc5d92858b8..d4e8073caf27 100644
--- a/drivers/input/joystick/guillemot.c
+++ b/drivers/input/joystick/guillemot.c
@@ -156,7 +156,7 @@ static void guillemot_poll(struct gameport *gameport)
156 156
157static int guillemot_open(struct input_dev *dev) 157static int guillemot_open(struct input_dev *dev)
158{ 158{
159 struct guillemot *guillemot = dev->private; 159 struct guillemot *guillemot = input_get_drvdata(dev);
160 160
161 gameport_start_polling(guillemot->gameport); 161 gameport_start_polling(guillemot->gameport);
162 return 0; 162 return 0;
@@ -168,7 +168,7 @@ static int guillemot_open(struct input_dev *dev)
168 168
169static void guillemot_close(struct input_dev *dev) 169static void guillemot_close(struct input_dev *dev)
170{ 170{
171 struct guillemot *guillemot = dev->private; 171 struct guillemot *guillemot = input_get_drvdata(dev);
172 172
173 gameport_stop_polling(guillemot->gameport); 173 gameport_stop_polling(guillemot->gameport);
174} 174}
@@ -231,8 +231,9 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver *
231 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GUILLEMOT; 231 input_dev->id.vendor = GAMEPORT_ID_VENDOR_GUILLEMOT;
232 input_dev->id.product = guillemot_type[i].id; 232 input_dev->id.product = guillemot_type[i].id;
233 input_dev->id.version = (int)data[14] << 8 | data[15]; 233 input_dev->id.version = (int)data[14] << 8 | data[15];
234 input_dev->cdev.dev = &gameport->dev; 234 input_dev->dev.parent = &gameport->dev;
235 input_dev->private = guillemot; 235
236 input_set_drvdata(input_dev, guillemot);
236 237
237 input_dev->open = guillemot_open; 238 input_dev->open = guillemot_open;
238 input_dev->close = guillemot_close; 239 input_dev->close = guillemot_close;
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c
index 8fb0c19cc60e..f2a4381d0ab8 100644
--- a/drivers/input/joystick/iforce/iforce-ff.c
+++ b/drivers/input/joystick/iforce/iforce-ff.c
@@ -2,7 +2,7 @@
2 * $Id: iforce-ff.c,v 1.9 2002/02/02 19:28:35 jdeneux Exp $ 2 * $Id: iforce-ff.c,v 1.9 2002/02/02 19:28:35 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
@@ -205,7 +205,7 @@ static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
205 int i; 205 int i;
206 206
207 if (new->type != FF_SPRING && new->type != FF_FRICTION) { 207 if (new->type != FF_SPRING && new->type != FF_FRICTION) {
208 printk(KERN_WARNING "iforce.c: bad effect type in need_condition_modifier\n"); 208 warn("bad effect type in need_condition_modifier");
209 return 0; 209 return 0;
210 } 210 }
211 211
@@ -227,7 +227,7 @@ static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
227static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effect) 227static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effect)
228{ 228{
229 if (effect->type != FF_CONSTANT) { 229 if (effect->type != FF_CONSTANT) {
230 printk(KERN_WARNING "iforce.c: bad effect type in need_envelope_modifier\n"); 230 warn("bad effect type in need_envelope_modifier");
231 return 0; 231 return 0;
232 } 232 }
233 233
@@ -258,7 +258,7 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
258 break; 258 break;
259 259
260 default: 260 default:
261 printk(KERN_WARNING "iforce.c: bad effect type in need_envelope_modifier\n"); 261 warn("bad effect type in need_envelope_modifier");
262 } 262 }
263 263
264 return 0; 264 return 0;
@@ -271,7 +271,7 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
271static int need_period_modifier(struct ff_effect *old, struct ff_effect *new) 271static int need_period_modifier(struct ff_effect *old, struct ff_effect *new)
272{ 272{
273 if (new->type != FF_PERIODIC) { 273 if (new->type != FF_PERIODIC) {
274 printk(KERN_WARNING "iforce.c: bad effect type in need_period_modifier\n"); 274 warn("bad effect type in need_period_modifier");
275 return 0; 275 return 0;
276 } 276 }
277 return (old->u.periodic.period != new->u.periodic.period 277 return (old->u.periodic.period != new->u.periodic.period
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
index 3393a37fec39..fb129c479a66 100644
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -2,7 +2,7 @@
2 * $Id: iforce-main.c,v 1.19 2002/07/07 10:22:50 jdeneux Exp $ 2 * $Id: iforce-main.c,v 1.19 2002/07/07 10:22:50 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
@@ -29,7 +29,7 @@
29 29
30#include "iforce.h" 30#include "iforce.h"
31 31
32MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>, Johann Deneux <deneux@ifrance.com>"); 32MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>, Johann Deneux <johann.deneux@gmail.com>");
33MODULE_DESCRIPTION("USB/RS232 I-Force joysticks and wheels driver"); 33MODULE_DESCRIPTION("USB/RS232 I-Force joysticks and wheels driver");
34MODULE_LICENSE("GPL"); 34MODULE_LICENSE("GPL");
35 35
@@ -220,7 +220,7 @@ static void iforce_release(struct input_dev *dev)
220 /* Check: no effects should be present in memory */ 220 /* Check: no effects should be present in memory */
221 for (i = 0; i < dev->ff->max_effects; i++) { 221 for (i = 0; i < dev->ff->max_effects; i++) {
222 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) { 222 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) {
223 printk(KERN_WARNING "iforce_release: Device still owns effects\n"); 223 warn("iforce_release: Device still owns effects");
224 break; 224 break;
225 } 225 }
226 } 226 }
@@ -232,7 +232,7 @@ static void iforce_release(struct input_dev *dev)
232 switch (iforce->bus) { 232 switch (iforce->bus) {
233#ifdef CONFIG_JOYSTICK_IFORCE_USB 233#ifdef CONFIG_JOYSTICK_IFORCE_USB
234 case IFORCE_USB: 234 case IFORCE_USB:
235 usb_unlink_urb(iforce->irq); 235 usb_kill_urb(iforce->irq);
236 236
237 /* The device was unplugged before the file 237 /* The device was unplugged before the file
238 * was released */ 238 * was released */
@@ -287,13 +287,13 @@ int iforce_init_device(struct iforce *iforce)
287#ifdef CONFIG_JOYSTICK_IFORCE_USB 287#ifdef CONFIG_JOYSTICK_IFORCE_USB
288 case IFORCE_USB: 288 case IFORCE_USB:
289 input_dev->id.bustype = BUS_USB; 289 input_dev->id.bustype = BUS_USB;
290 input_dev->cdev.dev = &iforce->usbdev->dev; 290 input_dev->dev.parent = &iforce->usbdev->dev;
291 break; 291 break;
292#endif 292#endif
293#ifdef CONFIG_JOYSTICK_IFORCE_232 293#ifdef CONFIG_JOYSTICK_IFORCE_232
294 case IFORCE_232: 294 case IFORCE_232:
295 input_dev->id.bustype = BUS_RS232; 295 input_dev->id.bustype = BUS_RS232;
296 input_dev->cdev.dev = &iforce->serio->dev; 296 input_dev->dev.parent = &iforce->serio->dev;
297 break; 297 break;
298#endif 298#endif
299 } 299 }
@@ -324,7 +324,7 @@ int iforce_init_device(struct iforce *iforce)
324 break; 324 break;
325 325
326 if (i == 20) { /* 5 seconds */ 326 if (i == 20) { /* 5 seconds */
327 printk(KERN_ERR "iforce-main.c: Timeout waiting for response from device.\n"); 327 err("Timeout waiting for response from device.");
328 error = -ENODEV; 328 error = -ENODEV;
329 goto fail; 329 goto fail;
330 } 330 }
@@ -336,26 +336,26 @@ int iforce_init_device(struct iforce *iforce)
336 if (!iforce_get_id_packet(iforce, "M")) 336 if (!iforce_get_id_packet(iforce, "M"))
337 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1]; 337 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1];
338 else 338 else
339 printk(KERN_WARNING "iforce-main.c: Device does not respond to id packet M\n"); 339 warn("Device does not respond to id packet M");
340 340
341 if (!iforce_get_id_packet(iforce, "P")) 341 if (!iforce_get_id_packet(iforce, "P"))
342 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1]; 342 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1];
343 else 343 else
344 printk(KERN_WARNING "iforce-main.c: Device does not respond to id packet P\n"); 344 warn("Device does not respond to id packet P");
345 345
346 if (!iforce_get_id_packet(iforce, "B")) 346 if (!iforce_get_id_packet(iforce, "B"))
347 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1]; 347 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1];
348 else 348 else
349 printk(KERN_WARNING "iforce-main.c: Device does not respond to id packet B\n"); 349 warn("Device does not respond to id packet B");
350 350
351 if (!iforce_get_id_packet(iforce, "N")) 351 if (!iforce_get_id_packet(iforce, "N"))
352 ff_effects = iforce->edata[1]; 352 ff_effects = iforce->edata[1];
353 else 353 else
354 printk(KERN_WARNING "iforce-main.c: Device does not respond to id packet N\n"); 354 warn("Device does not respond to id packet N");
355 355
356 /* Check if the device can store more effects than the driver can really handle */ 356 /* Check if the device can store more effects than the driver can really handle */
357 if (ff_effects > IFORCE_EFFECTS_MAX) { 357 if (ff_effects > IFORCE_EFFECTS_MAX) {
358 printk(KERN_WARNING "iforce: Limiting number of effects to %d (device reports %d)\n", 358 warn("Limiting number of effects to %d (device reports %d)",
359 IFORCE_EFFECTS_MAX, ff_effects); 359 IFORCE_EFFECTS_MAX, ff_effects);
360 ff_effects = IFORCE_EFFECTS_MAX; 360 ff_effects = IFORCE_EFFECTS_MAX;
361 } 361 }
@@ -457,8 +457,6 @@ int iforce_init_device(struct iforce *iforce)
457 if (error) 457 if (error)
458 goto fail; 458 goto fail;
459 459
460 printk(KERN_DEBUG "iforce->dev->open = %p\n", iforce->dev->open);
461
462 return 0; 460 return 0;
463 461
464 fail: input_free_device(input_dev); 462 fail: input_free_device(input_dev);
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 808f05932a6f..21c4e13d3a50 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -2,7 +2,7 @@
2 * $Id: iforce-packets.c,v 1.16 2002/07/07 10:22:50 jdeneux Exp $ 2 * $Id: iforce-packets.c,v 1.16 2002/07/07 10:22:50 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
@@ -39,10 +39,10 @@ void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data)
39{ 39{
40 int i; 40 int i;
41 41
42 printk(KERN_DEBUG "iforce.c: %s ( cmd = %04x, data = ", msg, cmd); 42 printk(KERN_DEBUG __FILE__ ": %s cmd = %04x, data = ", msg, cmd);
43 for (i = 0; i < LO(cmd); i++) 43 for (i = 0; i < LO(cmd); i++)
44 printk("%02x ", data[i]); 44 printk("%02x ", data[i]);
45 printk(")\n"); 45 printk("\n");
46} 46}
47 47
48/* 48/*
@@ -65,8 +65,9 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
65 head = iforce->xmit.head; 65 head = iforce->xmit.head;
66 tail = iforce->xmit.tail; 66 tail = iforce->xmit.tail;
67 67
68
68 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) { 69 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) {
69 printk(KERN_WARNING "iforce.c: not enough space in xmit buffer to send new packet\n"); 70 warn("not enough space in xmit buffer to send new packet");
70 spin_unlock_irqrestore(&iforce->xmit_lock, flags); 71 spin_unlock_irqrestore(&iforce->xmit_lock, flags);
71 return -1; 72 return -1;
72 } 73 }
@@ -126,8 +127,6 @@ int iforce_control_playback(struct iforce* iforce, u16 id, unsigned int value)
126{ 127{
127 unsigned char data[3]; 128 unsigned char data[3];
128 129
129printk(KERN_DEBUG "iforce-packets.c: control_playback %d %d\n", id, value);
130
131 data[0] = LO(id); 130 data[0] = LO(id);
132 data[1] = (value > 0) ? ((value > 1) ? 0x41 : 0x01) : 0; 131 data[1] = (value > 0) ? ((value > 1) ? 0x41 : 0x01) : 0;
133 data[2] = LO(value); 132 data[2] = LO(value);
@@ -151,7 +150,7 @@ static int mark_core_as_ready(struct iforce *iforce, unsigned short addr)
151 return 0; 150 return 0;
152 } 151 }
153 } 152 }
154 printk(KERN_WARNING "iforce-packets.c: unused effect %04x updated !!!\n", addr); 153 warn("unused effect %04x updated !!!", addr);
155 return -1; 154 return -1;
156} 155}
157 156
@@ -162,7 +161,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
162 static int being_used = 0; 161 static int being_used = 0;
163 162
164 if (being_used) 163 if (being_used)
165 printk(KERN_WARNING "iforce-packets.c: re-entrant call to iforce_process %d\n", being_used); 164 warn("re-entrant call to iforce_process %d", being_used);
166 being_used++; 165 being_used++;
167 166
168#ifdef CONFIG_JOYSTICK_IFORCE_232 167#ifdef CONFIG_JOYSTICK_IFORCE_232
@@ -266,7 +265,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
266 return -1; 265 return -1;
267 } 266 }
268#else 267#else
269 printk(KERN_ERR "iforce_get_id_packet: iforce->bus = USB!\n"); 268 err("iforce_get_id_packet: iforce->bus = USB!");
270#endif 269#endif
271 break; 270 break;
272 271
@@ -284,13 +283,12 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
284 return -1; 283 return -1;
285 } 284 }
286#else 285#else
287 printk(KERN_ERR "iforce_get_id_packet: iforce->bus = SERIO!\n"); 286 err("iforce_get_id_packet: iforce->bus = SERIO!");
288#endif 287#endif
289 break; 288 break;
290 289
291 default: 290 default:
292 printk(KERN_ERR "iforce_get_id_packet: iforce->bus = %d\n", 291 err("iforce_get_id_packet: iforce->bus = %d", iforce->bus);
293 iforce->bus);
294 break; 292 break;
295 } 293 }
296 294
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
index ec4be535f483..7b4bc19cef27 100644
--- a/drivers/input/joystick/iforce/iforce-serio.c
+++ b/drivers/input/joystick/iforce/iforce-serio.c
@@ -2,7 +2,7 @@
2 * $Id: iforce-serio.c,v 1.4 2002/01/28 22:45:00 jdeneux Exp $ 2 * $Id: iforce-serio.c,v 1.4 2002/01/28 22:45:00 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 80cdebcbcb99..750099d8e3c6 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -2,7 +2,7 @@
2 * $Id: iforce-usb.c,v 1.16 2002/06/09 11:08:04 jdeneux Exp $ 2 * $Id: iforce-usb.c,v 1.16 2002/06/09 11:08:04 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
@@ -65,7 +65,7 @@ void iforce_usb_xmit(struct iforce *iforce)
65 XMIT_INC(iforce->xmit.tail, n); 65 XMIT_INC(iforce->xmit.tail, n);
66 66
67 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { 67 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
68 printk(KERN_WARNING "iforce-usb.c: iforce_usb_xmit: usb_submit_urb failed %d\n", n); 68 warn("usb_submit_urb failed %d\n", n);
69 } 69 }
70 70
71 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. 71 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
@@ -110,7 +110,7 @@ static void iforce_usb_out(struct urb *urb)
110 struct iforce *iforce = urb->context; 110 struct iforce *iforce = urb->context;
111 111
112 if (urb->status) { 112 if (urb->status) {
113 printk(KERN_DEBUG "iforce_usb_out: urb->status %d, exiting", urb->status); 113 dbg("urb->status %d, exiting", urb->status);
114 return; 114 return;
115 } 115 }
116 116
@@ -190,10 +190,9 @@ fail:
190/* Called by iforce_delete() */ 190/* Called by iforce_delete() */
191void iforce_usb_delete(struct iforce* iforce) 191void iforce_usb_delete(struct iforce* iforce)
192{ 192{
193 usb_unlink_urb(iforce->irq); 193 usb_kill_urb(iforce->irq);
194/* Is it ok to unlink those ? */ 194 usb_kill_urb(iforce->out);
195 usb_unlink_urb(iforce->out); 195 usb_kill_urb(iforce->ctrl);
196 usb_unlink_urb(iforce->ctrl);
197 196
198 usb_free_urb(iforce->irq); 197 usb_free_urb(iforce->irq);
199 usb_free_urb(iforce->out); 198 usb_free_urb(iforce->out);
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index ffaeaefa1a42..dadcf4fb92ae 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -2,7 +2,7 @@
2 * $Id: iforce.h,v 1.13 2002/07/07 10:22:50 jdeneux Exp $ 2 * $Id: iforce.h,v 1.13 2002/07/07 10:22:50 jdeneux Exp $
3 * 3 *
4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 5 * Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
6 * 6 *
7 * USB/RS232 I-Force joysticks and wheels. 7 * USB/RS232 I-Force joysticks and wheels.
8 */ 8 */
diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c
index fec8b3d0967d..1aec1e9d7c59 100644
--- a/drivers/input/joystick/interact.c
+++ b/drivers/input/joystick/interact.c
@@ -185,7 +185,7 @@ static void interact_poll(struct gameport *gameport)
185 185
186static int interact_open(struct input_dev *dev) 186static int interact_open(struct input_dev *dev)
187{ 187{
188 struct interact *interact = dev->private; 188 struct interact *interact = input_get_drvdata(dev);
189 189
190 gameport_start_polling(interact->gameport); 190 gameport_start_polling(interact->gameport);
191 return 0; 191 return 0;
@@ -197,7 +197,7 @@ static int interact_open(struct input_dev *dev)
197 197
198static void interact_close(struct input_dev *dev) 198static void interact_close(struct input_dev *dev)
199{ 199{
200 struct interact *interact = dev->private; 200 struct interact *interact = input_get_drvdata(dev);
201 201
202 gameport_stop_polling(interact->gameport); 202 gameport_stop_polling(interact->gameport);
203} 203}
@@ -262,7 +262,9 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d
262 input_dev->id.vendor = GAMEPORT_ID_VENDOR_INTERACT; 262 input_dev->id.vendor = GAMEPORT_ID_VENDOR_INTERACT;
263 input_dev->id.product = interact_type[i].id; 263 input_dev->id.product = interact_type[i].id;
264 input_dev->id.version = 0x0100; 264 input_dev->id.version = 0x0100;
265 input_dev->private = interact; 265 input_dev->dev.parent = &gameport->dev;
266
267 input_set_drvdata(input_dev, interact);
266 268
267 input_dev->open = interact_open; 269 input_dev->open = interact_open;
268 input_dev->close = interact_close; 270 input_dev->close = interact_close;
diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c
index 4112789f1196..b35604ee43ae 100644
--- a/drivers/input/joystick/magellan.c
+++ b/drivers/input/joystick/magellan.c
@@ -168,8 +168,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv)
168 input_dev->id.vendor = SERIO_MAGELLAN; 168 input_dev->id.vendor = SERIO_MAGELLAN;
169 input_dev->id.product = 0x0001; 169 input_dev->id.product = 0x0001;
170 input_dev->id.version = 0x0100; 170 input_dev->id.version = 0x0100;
171 input_dev->cdev.dev = &serio->dev; 171 input_dev->dev.parent = &serio->dev;
172 input_dev->private = magellan;
173 172
174 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 173 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
175 174
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index e58b22c018e4..2adf73f63c94 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -509,7 +509,7 @@ static void sw_poll(struct gameport *gameport)
509 509
510static int sw_open(struct input_dev *dev) 510static int sw_open(struct input_dev *dev)
511{ 511{
512 struct sw *sw = dev->private; 512 struct sw *sw = input_get_drvdata(dev);
513 513
514 gameport_start_polling(sw->gameport); 514 gameport_start_polling(sw->gameport);
515 return 0; 515 return 0;
@@ -517,7 +517,7 @@ static int sw_open(struct input_dev *dev)
517 517
518static void sw_close(struct input_dev *dev) 518static void sw_close(struct input_dev *dev)
519{ 519{
520 struct sw *sw = dev->private; 520 struct sw *sw = input_get_drvdata(dev);
521 521
522 gameport_stop_polling(sw->gameport); 522 gameport_stop_polling(sw->gameport);
523} 523}
@@ -751,8 +751,9 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
751 input_dev->id.vendor = GAMEPORT_ID_VENDOR_MICROSOFT; 751 input_dev->id.vendor = GAMEPORT_ID_VENDOR_MICROSOFT;
752 input_dev->id.product = sw->type; 752 input_dev->id.product = sw->type;
753 input_dev->id.version = 0x0100; 753 input_dev->id.version = 0x0100;
754 input_dev->cdev.dev = &gameport->dev; 754 input_dev->dev.parent = &gameport->dev;
755 input_dev->private = sw; 755
756 input_set_drvdata(input_dev, sw);
756 757
757 input_dev->open = sw_open; 758 input_dev->open = sw_open;
758 input_dev->close = sw_close; 759 input_dev->close = sw_close;
diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c
index 08bf113e62eb..abb7c4cf54ad 100644
--- a/drivers/input/joystick/spaceball.c
+++ b/drivers/input/joystick/spaceball.c
@@ -226,8 +226,7 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv)
226 input_dev->id.vendor = SERIO_SPACEBALL; 226 input_dev->id.vendor = SERIO_SPACEBALL;
227 input_dev->id.product = id; 227 input_dev->id.product = id;
228 input_dev->id.version = 0x0100; 228 input_dev->id.version = 0x0100;
229 input_dev->cdev.dev = &serio->dev; 229 input_dev->dev.parent = &serio->dev;
230 input_dev->private = spaceball;
231 230
232 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 231 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
233 232
diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c
index c9c79211af71..c4937f1e837c 100644
--- a/drivers/input/joystick/spaceorb.c
+++ b/drivers/input/joystick/spaceorb.c
@@ -183,8 +183,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv)
183 input_dev->id.vendor = SERIO_SPACEORB; 183 input_dev->id.vendor = SERIO_SPACEORB;
184 input_dev->id.product = 0x0001; 184 input_dev->id.product = 0x0001;
185 input_dev->id.version = 0x0100; 185 input_dev->id.version = 0x0100;
186 input_dev->cdev.dev = &serio->dev; 186 input_dev->dev.parent = &serio->dev;
187 input_dev->private = spaceorb;
188 187
189 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 188 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
190 189
diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c
index ecb0916215fa..8581ee991d4e 100644
--- a/drivers/input/joystick/stinger.c
+++ b/drivers/input/joystick/stinger.c
@@ -154,8 +154,7 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv)
154 input_dev->id.vendor = SERIO_STINGER; 154 input_dev->id.vendor = SERIO_STINGER;
155 input_dev->id.product = 0x0001; 155 input_dev->id.product = 0x0001;
156 input_dev->id.version = 0x0100; 156 input_dev->id.version = 0x0100;
157 input_dev->cdev.dev = &serio->dev; 157 input_dev->dev.parent = &serio->dev;
158 input_dev->private = stinger;
159 158
160 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 159 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
161 input_dev->keybit[LONG(BTN_A)] = BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_X) | 160 input_dev->keybit[LONG(BTN_A)] = BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_X) |
diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c
index bb23ed2a04a6..3b36ee04f726 100644
--- a/drivers/input/joystick/tmdc.c
+++ b/drivers/input/joystick/tmdc.c
@@ -265,7 +265,7 @@ static void tmdc_poll(struct gameport *gameport)
265 265
266static int tmdc_open(struct input_dev *dev) 266static int tmdc_open(struct input_dev *dev)
267{ 267{
268 struct tmdc *tmdc = dev->private; 268 struct tmdc *tmdc = input_get_drvdata(dev);
269 269
270 gameport_start_polling(tmdc->gameport); 270 gameport_start_polling(tmdc->gameport);
271 return 0; 271 return 0;
@@ -273,7 +273,7 @@ static int tmdc_open(struct input_dev *dev)
273 273
274static void tmdc_close(struct input_dev *dev) 274static void tmdc_close(struct input_dev *dev)
275{ 275{
276 struct tmdc *tmdc = dev->private; 276 struct tmdc *tmdc = input_get_drvdata(dev);
277 277
278 gameport_stop_polling(tmdc->gameport); 278 gameport_stop_polling(tmdc->gameport);
279} 279}
@@ -326,8 +326,9 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
326 input_dev->id.vendor = GAMEPORT_ID_VENDOR_THRUSTMASTER; 326 input_dev->id.vendor = GAMEPORT_ID_VENDOR_THRUSTMASTER;
327 input_dev->id.product = model->id; 327 input_dev->id.product = model->id;
328 input_dev->id.version = 0x0100; 328 input_dev->id.version = 0x0100;
329 input_dev->cdev.dev = &tmdc->gameport->dev; 329 input_dev->dev.parent = &tmdc->gameport->dev;
330 input_dev->private = tmdc; 330
331 input_set_drvdata(input_dev, tmdc);
331 332
332 input_dev->open = tmdc_open; 333 input_dev->open = tmdc_open;
333 input_dev->close = tmdc_close; 334 input_dev->close = tmdc_close;
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c
index 037d3487fcc7..0f2c60823b0b 100644
--- a/drivers/input/joystick/turbografx.c
+++ b/drivers/input/joystick/turbografx.c
@@ -122,7 +122,7 @@ static void tgfx_timer(unsigned long private)
122 122
123static int tgfx_open(struct input_dev *dev) 123static int tgfx_open(struct input_dev *dev)
124{ 124{
125 struct tgfx *tgfx = dev->private; 125 struct tgfx *tgfx = input_get_drvdata(dev);
126 int err; 126 int err;
127 127
128 err = mutex_lock_interruptible(&tgfx->sem); 128 err = mutex_lock_interruptible(&tgfx->sem);
@@ -141,7 +141,7 @@ static int tgfx_open(struct input_dev *dev)
141 141
142static void tgfx_close(struct input_dev *dev) 142static void tgfx_close(struct input_dev *dev)
143{ 143{
144 struct tgfx *tgfx = dev->private; 144 struct tgfx *tgfx = input_get_drvdata(dev);
145 145
146 mutex_lock(&tgfx->sem); 146 mutex_lock(&tgfx->sem);
147 if (!--tgfx->used) { 147 if (!--tgfx->used) {
@@ -224,7 +224,8 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs)
224 input_dev->id.product = n_buttons[i]; 224 input_dev->id.product = n_buttons[i];
225 input_dev->id.version = 0x0100; 225 input_dev->id.version = 0x0100;
226 226
227 input_dev->private = tgfx; 227 input_set_drvdata(input_dev, tgfx);
228
228 input_dev->open = tgfx_open; 229 input_dev->open = tgfx_open;
229 input_dev->close = tgfx_close; 230 input_dev->close = tgfx_close;
230 231
diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c
index 9cf17d6ced82..c91504ec38eb 100644
--- a/drivers/input/joystick/twidjoy.c
+++ b/drivers/input/joystick/twidjoy.c
@@ -205,11 +205,9 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv)
205 input_dev->id.vendor = SERIO_TWIDJOY; 205 input_dev->id.vendor = SERIO_TWIDJOY;
206 input_dev->id.product = 0x0001; 206 input_dev->id.product = 0x0001;
207 input_dev->id.version = 0x0100; 207 input_dev->id.version = 0x0100;
208 input_dev->cdev.dev = &serio->dev; 208 input_dev->dev.parent = &serio->dev;
209 input_dev->private = twidjoy;
210 209
211 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 210 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
212 input_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
213 input_set_abs_params(input_dev, ABS_X, -50, 50, 4, 4); 211 input_set_abs_params(input_dev, ABS_X, -50, 50, 4, 4);
214 input_set_abs_params(input_dev, ABS_Y, -50, 50, 4, 4); 212 input_set_abs_params(input_dev, ABS_Y, -50, 50, 4, 4);
215 213
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c
index 29d339acf430..4e85f72eefd7 100644
--- a/drivers/input/joystick/warrior.c
+++ b/drivers/input/joystick/warrior.c
@@ -160,8 +160,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv)
160 input_dev->id.vendor = SERIO_WARRIOR; 160 input_dev->id.vendor = SERIO_WARRIOR;
161 input_dev->id.product = 0x0001; 161 input_dev->id.product = 0x0001;
162 input_dev->id.version = 0x0100; 162 input_dev->id.version = 0x0100;
163 input_dev->cdev.dev = &serio->dev; 163 input_dev->dev.parent = &serio->dev;
164 input_dev->private = warrior;
165 164
166 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS); 165 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
167 input_dev->keybit[LONG(BTN_TRIGGER)] = BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_TOP2); 166 input_dev->keybit[LONG(BTN_TRIGGER)] = BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_TOP2);