diff options
Diffstat (limited to 'drivers/input/joystick')
23 files changed, 67 insertions, 272 deletions
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c index 1639ab2b94b7..85bc8dc07cfc 100644 --- a/drivers/input/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c @@ -413,15 +413,4 @@ static struct gameport_driver a3d_drv = { .disconnect = a3d_disconnect, }; -static int __init a3d_init(void) -{ - return gameport_register_driver(&a3d_drv); -} - -static void __exit a3d_exit(void) -{ - gameport_unregister_driver(&a3d_drv); -} - -module_init(a3d_init); -module_exit(a3d_exit); +module_gameport_driver(a3d_drv); diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c index b992fbf91f2f..0cbfd2dfabf4 100644 --- a/drivers/input/joystick/adi.c +++ b/drivers/input/joystick/adi.c @@ -557,10 +557,6 @@ static void adi_disconnect(struct gameport *gameport) kfree(port); } -/* - * The gameport device structure. - */ - static struct gameport_driver adi_drv = { .driver = { .name = "adi", @@ -570,15 +566,4 @@ static struct gameport_driver adi_drv = { .disconnect = adi_disconnect, }; -static int __init adi_init(void) -{ - return gameport_register_driver(&adi_drv); -} - -static void __exit adi_exit(void) -{ - gameport_unregister_driver(&adi_drv); -} - -module_init(adi_init); -module_exit(adi_exit); +module_gameport_driver(adi_drv); diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c index 3497b87c3d05..65367e44d715 100644 --- a/drivers/input/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c @@ -261,15 +261,4 @@ static struct gameport_driver cobra_drv = { .disconnect = cobra_disconnect, }; -static int __init cobra_init(void) -{ - return gameport_register_driver(&cobra_drv); -} - -static void __exit cobra_exit(void) -{ - gameport_unregister_driver(&cobra_drv); -} - -module_init(cobra_init); -module_exit(cobra_exit); +module_gameport_driver(cobra_drv); diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index 0536b1b2f018..ab1cf2882004 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c @@ -373,15 +373,4 @@ static struct gameport_driver gf2k_drv = { .disconnect = gf2k_disconnect, }; -static int __init gf2k_init(void) -{ - return gameport_register_driver(&gf2k_drv); -} - -static void __exit gf2k_exit(void) -{ - gameport_unregister_driver(&gf2k_drv); -} - -module_init(gf2k_init); -module_exit(gf2k_exit); +module_gameport_driver(gf2k_drv); diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c index fc55899ba6c5..9e1beff57c33 100644 --- a/drivers/input/joystick/grip.c +++ b/drivers/input/joystick/grip.c @@ -424,15 +424,4 @@ static struct gameport_driver grip_drv = { .disconnect = grip_disconnect, }; -static int __init grip_init(void) -{ - return gameport_register_driver(&grip_drv); -} - -static void __exit grip_exit(void) -{ - gameport_unregister_driver(&grip_drv); -} - -module_init(grip_init); -module_exit(grip_exit); +module_gameport_driver(grip_drv); diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 2d47baf47769..c0f9c7b7eb4e 100644 --- a/drivers/input/joystick/grip_mp.c +++ b/drivers/input/joystick/grip_mp.c @@ -687,15 +687,4 @@ static struct gameport_driver grip_drv = { .disconnect = grip_disconnect, }; -static int __init grip_init(void) -{ - return gameport_register_driver(&grip_drv); -} - -static void __exit grip_exit(void) -{ - gameport_unregister_driver(&grip_drv); -} - -module_init(grip_init); -module_exit(grip_exit); +module_gameport_driver(grip_drv); diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c index 4058d4b272fe..55196f730af6 100644 --- a/drivers/input/joystick/guillemot.c +++ b/drivers/input/joystick/guillemot.c @@ -281,15 +281,4 @@ static struct gameport_driver guillemot_drv = { .disconnect = guillemot_disconnect, }; -static int __init guillemot_init(void) -{ - return gameport_register_driver(&guillemot_drv); -} - -static void __exit guillemot_exit(void) -{ - gameport_unregister_driver(&guillemot_drv); -} - -module_init(guillemot_init); -module_exit(guillemot_exit); +module_gameport_driver(guillemot_drv); diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 405febd94f24..daeeb4c7e3b0 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c @@ -317,7 +317,8 @@ int iforce_init_device(struct iforce *iforce) break; if (i == 20) { /* 5 seconds */ - err("Timeout waiting for response from device."); + dev_err(&input_dev->dev, + "Timeout waiting for response from device.\n"); error = -ENODEV; goto fail; } diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c index a17b50016009..08f98f2eaf88 100644 --- a/drivers/input/joystick/iforce/iforce-packets.c +++ b/drivers/input/joystick/iforce/iforce-packets.c @@ -257,7 +257,8 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet) status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC); if (status) { - err("usb_submit_urb failed %d", status); + dev_err(&iforce->intf->dev, + "usb_submit_urb failed %d\n", status); return -1; } @@ -265,12 +266,14 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet) iforce->ctrl->status != -EINPROGRESS, HZ); if (iforce->ctrl->status) { - dbg("iforce->ctrl->status = %d", iforce->ctrl->status); + dev_dbg(&iforce->intf->dev, + "iforce->ctrl->status = %d\n", + iforce->ctrl->status); usb_unlink_urb(iforce->ctrl); return -1; } #else - dbg("iforce_get_id_packet: iforce->bus = USB!"); + printk(KERN_DEBUG "iforce_get_id_packet: iforce->bus = USB!\n"); #endif } break; @@ -289,12 +292,15 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet) return -1; } #else - err("iforce_get_id_packet: iforce->bus = SERIO!"); + dev_err(&iforce->dev->dev, + "iforce_get_id_packet: iforce->bus = SERIO!\n"); #endif break; default: - err("iforce_get_id_packet: iforce->bus = %d", iforce->bus); + dev_err(&iforce->dev->dev, + "iforce_get_id_packet: iforce->bus = %d\n", + iforce->bus); break; } diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index 6c96631ae5d9..d96aa27dfcdc 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -64,7 +64,7 @@ void iforce_usb_xmit(struct iforce *iforce) if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); - dev_warn(&iforce->dev->dev, "usb_submit_urb failed %d\n", n); + dev_warn(&iforce->intf->dev, "usb_submit_urb failed %d\n", n); } /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. @@ -76,6 +76,7 @@ void iforce_usb_xmit(struct iforce *iforce) static void iforce_usb_irq(struct urb *urb) { struct iforce *iforce = urb->context; + struct device *dev = &iforce->intf->dev; int status; switch (urb->status) { @@ -86,11 +87,12 @@ static void iforce_usb_irq(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ - dbg("%s - urb shutting down with status: %d", - __func__, urb->status); + dev_dbg(dev, "%s - urb shutting down with status: %d\n", + __func__, urb->status); return; default: - dbg("%s - urb has status of: %d", __func__, urb->status); + dev_dbg(dev, "%s - urb has status of: %d\n", + __func__, urb->status); goto exit; } @@ -100,8 +102,8 @@ static void iforce_usb_irq(struct urb *urb) exit: status = usb_submit_urb (urb, GFP_ATOMIC); if (status) - err ("%s - usb_submit_urb failed with result %d", - __func__, status); + dev_err(dev, "%s - usb_submit_urb failed with result %d\n", + __func__, status); } static void iforce_usb_out(struct urb *urb) @@ -110,7 +112,8 @@ static void iforce_usb_out(struct urb *urb) if (urb->status) { clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); - dbg("urb->status %d, exiting", urb->status); + dev_dbg(&iforce->intf->dev, "urb->status %d, exiting\n", + urb->status); return; } @@ -155,6 +158,7 @@ static int iforce_usb_probe(struct usb_interface *intf, iforce->bus = IFORCE_USB; iforce->usbdev = dev; + iforce->intf = intf; iforce->cr.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_INTERFACE; iforce->cr.wIndex = 0; diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h index 9f494b75848a..b1d7d9b0eb86 100644 --- a/drivers/input/joystick/iforce/iforce.h +++ b/drivers/input/joystick/iforce/iforce.h @@ -115,6 +115,7 @@ struct iforce { #endif #ifdef CONFIG_JOYSTICK_IFORCE_USB struct usb_device *usbdev; /* USB transfer */ + struct usb_interface *intf; struct urb *irq, *out, *ctrl; struct usb_ctrlrequest cr; #endif diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c index 16fb19d1ca25..88c22623a2e8 100644 --- a/drivers/input/joystick/interact.c +++ b/drivers/input/joystick/interact.c @@ -311,15 +311,4 @@ static struct gameport_driver interact_drv = { .disconnect = interact_disconnect, }; -static int __init interact_init(void) -{ - return gameport_register_driver(&interact_drv); -} - -static void __exit interact_exit(void) -{ - gameport_unregister_driver(&interact_drv); -} - -module_init(interact_init); -module_exit(interact_exit); +module_gameport_driver(interact_drv); diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c index cd894a0564a2..7eb878bab968 100644 --- a/drivers/input/joystick/joydump.c +++ b/drivers/input/joystick/joydump.c @@ -159,15 +159,4 @@ static struct gameport_driver joydump_drv = { .disconnect = joydump_disconnect, }; -static int __init joydump_init(void) -{ - return gameport_register_driver(&joydump_drv); -} - -static void __exit joydump_exit(void) -{ - gameport_unregister_driver(&joydump_drv); -} - -module_init(joydump_init); -module_exit(joydump_exit); +module_gameport_driver(joydump_drv); diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c index 40e40780747d..9fb153eef2fc 100644 --- a/drivers/input/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c @@ -222,19 +222,4 @@ static struct serio_driver magellan_drv = { .disconnect = magellan_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init magellan_init(void) -{ - return serio_register_driver(&magellan_drv); -} - -static void __exit magellan_exit(void) -{ - serio_unregister_driver(&magellan_drv); -} - -module_init(magellan_init); -module_exit(magellan_exit); +module_serio_driver(magellan_drv); diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index b8d86115644b..04c69af37148 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -820,15 +820,4 @@ static struct gameport_driver sw_drv = { .disconnect = sw_disconnect, }; -static int __init sw_init(void) -{ - return gameport_register_driver(&sw_drv); -} - -static void __exit sw_exit(void) -{ - gameport_unregister_driver(&sw_drv); -} - -module_init(sw_init); -module_exit(sw_exit); +module_gameport_driver(sw_drv); diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index 0cd9b29356a8..80a7b27a457a 100644 --- a/drivers/input/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c @@ -296,19 +296,4 @@ static struct serio_driver spaceball_drv = { .disconnect = spaceball_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init spaceball_init(void) -{ - return serio_register_driver(&spaceball_drv); -} - -static void __exit spaceball_exit(void) -{ - serio_unregister_driver(&spaceball_drv); -} - -module_init(spaceball_init); -module_exit(spaceball_exit); +module_serio_driver(spaceball_drv); diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index a694bf8e557b..a41f291652e6 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c @@ -237,19 +237,4 @@ static struct serio_driver spaceorb_drv = { .disconnect = spaceorb_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init spaceorb_init(void) -{ - return serio_register_driver(&spaceorb_drv); -} - -static void __exit spaceorb_exit(void) -{ - serio_unregister_driver(&spaceorb_drv); -} - -module_init(spaceorb_init); -module_exit(spaceorb_exit); +module_serio_driver(spaceorb_drv); diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c index e0db9f5e4b41..0f51a60e14a7 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c @@ -208,19 +208,4 @@ static struct serio_driver stinger_drv = { .disconnect = stinger_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init stinger_init(void) -{ - return serio_register_driver(&stinger_drv); -} - -static void __exit stinger_exit(void) -{ - serio_unregister_driver(&stinger_drv); -} - -module_init(stinger_init); -module_exit(stinger_exit); +module_serio_driver(stinger_drv); diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c index d6c609807115..5ef9bcdb0345 100644 --- a/drivers/input/joystick/tmdc.c +++ b/drivers/input/joystick/tmdc.c @@ -436,15 +436,4 @@ static struct gameport_driver tmdc_drv = { .disconnect = tmdc_disconnect, }; -static int __init tmdc_init(void) -{ - return gameport_register_driver(&tmdc_drv); -} - -static void __exit tmdc_exit(void) -{ - gameport_unregister_driver(&tmdc_drv); -} - -module_init(tmdc_init); -module_exit(tmdc_exit); +module_gameport_driver(tmdc_drv); diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c index 3f4ec73c9553..2556a8193579 100644 --- a/drivers/input/joystick/twidjoy.c +++ b/drivers/input/joystick/twidjoy.c @@ -257,19 +257,4 @@ static struct serio_driver twidjoy_drv = { .disconnect = twidjoy_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init twidjoy_init(void) -{ - return serio_register_driver(&twidjoy_drv); -} - -static void __exit twidjoy_exit(void) -{ - serio_unregister_driver(&twidjoy_drv); -} - -module_init(twidjoy_init); -module_exit(twidjoy_exit); +module_serio_driver(twidjoy_drv); diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index f72c83e15e60..23b3071abb6e 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c @@ -217,19 +217,4 @@ static struct serio_driver warrior_drv = { .disconnect = warrior_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init warrior_init(void) -{ - return serio_register_driver(&warrior_drv); -} - -static void __exit warrior_exit(void) -{ - serio_unregister_driver(&warrior_drv); -} - -module_init(warrior_init); -module_exit(warrior_exit); +module_serio_driver(warrior_drv); diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index fd7a0d5bc94d..ee16fb67b7ae 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -252,6 +252,7 @@ MODULE_DEVICE_TABLE (usb, xpad_table); struct usb_xpad { struct input_dev *dev; /* input device interface */ struct usb_device *udev; /* usb device */ + struct usb_interface *intf; /* usb interface */ int pad_present; @@ -457,6 +458,7 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha static void xpad_irq_in(struct urb *urb) { struct usb_xpad *xpad = urb->context; + struct device *dev = &xpad->intf->dev; int retval, status; status = urb->status; @@ -469,11 +471,11 @@ static void xpad_irq_in(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ - dbg("%s - urb shutting down with status: %d", + dev_dbg(dev, "%s - urb shutting down with status: %d\n", __func__, status); return; default: - dbg("%s - nonzero urb status received: %d", + dev_dbg(dev, "%s - nonzero urb status received: %d\n", __func__, status); goto exit; } @@ -492,12 +494,15 @@ static void xpad_irq_in(struct urb *urb) exit: retval = usb_submit_urb(urb, GFP_ATOMIC); if (retval) - err ("%s - usb_submit_urb failed with result %d", - __func__, retval); + dev_err(dev, "%s - usb_submit_urb failed with result %d\n", + __func__, retval); } static void xpad_bulk_out(struct urb *urb) { + struct usb_xpad *xpad = urb->context; + struct device *dev = &xpad->intf->dev; + switch (urb->status) { case 0: /* success */ @@ -506,16 +511,20 @@ static void xpad_bulk_out(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ - dbg("%s - urb shutting down with status: %d", __func__, urb->status); + dev_dbg(dev, "%s - urb shutting down with status: %d\n", + __func__, urb->status); break; default: - dbg("%s - nonzero urb status received: %d", __func__, urb->status); + dev_dbg(dev, "%s - nonzero urb status received: %d\n", + __func__, urb->status); } } #if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS) static void xpad_irq_out(struct urb *urb) { + struct usb_xpad *xpad = urb->context; + struct device *dev = &xpad->intf->dev; int retval, status; status = urb->status; @@ -529,19 +538,21 @@ static void xpad_irq_out(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* this urb is terminated, clean up */ - dbg("%s - urb shutting down with status: %d", __func__, status); + dev_dbg(dev, "%s - urb shutting down with status: %d\n", + __func__, status); return; default: - dbg("%s - nonzero urb status received: %d", __func__, status); + dev_dbg(dev, "%s - nonzero urb status received: %d\n", + __func__, status); goto exit; } exit: retval = usb_submit_urb(urb, GFP_ATOMIC); if (retval) - err("%s - usb_submit_urb failed with result %d", - __func__, retval); + dev_err(dev, "%s - usb_submit_urb failed with result %d\n", + __func__, retval); } static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad) @@ -654,7 +665,8 @@ static int xpad_play_effect(struct input_dev *dev, void *data, struct ff_effect return usb_submit_urb(xpad->irq_out, GFP_ATOMIC); default: - dbg("%s - rumble command sent to unsupported xpad type: %d", + dev_dbg(&xpad->dev->dev, + "%s - rumble command sent to unsupported xpad type: %d\n", __func__, xpad->xtype); return -1; } @@ -844,6 +856,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id } xpad->udev = udev; + xpad->intf = intf; xpad->mapping = xpad_device[i].mapping; xpad->xtype = xpad_device[i].xtype; diff --git a/drivers/input/joystick/zhenhua.c b/drivers/input/joystick/zhenhua.c index b5853125c898..c4de4388fd7f 100644 --- a/drivers/input/joystick/zhenhua.c +++ b/drivers/input/joystick/zhenhua.c @@ -225,19 +225,4 @@ static struct serio_driver zhenhua_drv = { .disconnect = zhenhua_disconnect, }; -/* - * The functions for inserting/removing us as a module. - */ - -static int __init zhenhua_init(void) -{ - return serio_register_driver(&zhenhua_drv); -} - -static void __exit zhenhua_exit(void) -{ - serio_unregister_driver(&zhenhua_drv); -} - -module_init(zhenhua_init); -module_exit(zhenhua_exit); +module_serio_driver(zhenhua_drv); |