USB: convert drivers/input/* to use module_usb_driver()
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Nov 2011 17:48:31 +0000 (09:48 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Nov 2011 17:48:31 +0000 (09:48 -0800)
This converts the drivers in drivers/input/* to use the
module_usb_driver() macro which makes the code smaller and a bit
simpler.

Added bonus is that it removes some unneeded kernel log messages about
drivers loading and/or unloading.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Ville Syrjala <syrjala@sci.fi>
Cc: Henk Vergonet <Henk.Vergonet@gmail.com>
Cc: Alessandro Rubini <rubini@ipvvis.unipv.it>
Cc: Henrik Rydberg <rydberg@euromail.se>
Cc: "Magnus Hörlin" <magnus@alefors.se>
Cc: Chris Moeller <kode54@gmail.c>
Cc: Christoph Fritz <chf.fritz@googlemail.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Jesper Juhl <jj@chaosbits.net>
Cc: Edwin van Vliet <edwin@cheatah.nl>
Cc: Ping Cheng <pingc@wacom.com>
Cc: Eduard Hasenleithner <eduard@hasenleithner.at>
Cc: Alexander Strakh <strakh@ispras.ru>
Cc: Glenn Sommer <gsommer@datanordisk.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 files changed:
drivers/input/joystick/xpad.c
drivers/input/misc/ati_remote2.c
drivers/input/misc/keyspan_remote.c
drivers/input/misc/powermate.c
drivers/input/misc/yealink.c
drivers/input/mouse/appletouch.c
drivers/input/mouse/bcm5974.c
drivers/input/tablet/acecad.c
drivers/input/tablet/aiptek.c
drivers/input/tablet/gtco.c
drivers/input/tablet/hanwang.c
drivers/input/tablet/kbtab.c
drivers/input/tablet/wacom_sys.c
drivers/input/touchscreen/usbtouchscreen.c

index d72887585a14d5ba12cce8666dc80eb1f2dbf5ab..32bbd4c77b7c5da7f6ef4e4b18871f0df2ebc3bd 100644 (file)
@@ -1041,18 +1041,7 @@ static struct usb_driver xpad_driver = {
        .id_table       = xpad_table,
 };
 
-static int __init usb_xpad_init(void)
-{
-       return usb_register(&xpad_driver);
-}
-
-static void __exit usb_xpad_exit(void)
-{
-       usb_deregister(&xpad_driver);
-}
-
-module_init(usb_xpad_init);
-module_exit(usb_xpad_exit);
+module_usb_driver(xpad_driver);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
index 8d345e87075e6b8704ef72231f59e4d477374d73..874a51c2fbb2821049be81efc57dbff86b6b3525 100644 (file)
@@ -1010,23 +1010,4 @@ static int ati_remote2_post_reset(struct usb_interface *interface)
        return r;
 }
 
-static int __init ati_remote2_init(void)
-{
-       int r;
-
-       r = usb_register(&ati_remote2_driver);
-       if (r)
-               printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r);
-       else
-               printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n");
-
-       return r;
-}
-
-static void __exit ati_remote2_exit(void)
-{
-       usb_deregister(&ati_remote2_driver);
-}
-
-module_init(ati_remote2_init);
-module_exit(ati_remote2_exit);
+module_usb_driver(ati_remote2_driver);
index fc62256c963f6ff60167de1e84a8ae9c636a59b1..d99151a8bf106ba949d3c0514fe94540dfe54515 100644 (file)
@@ -580,26 +580,7 @@ static struct usb_driver keyspan_driver =
        .id_table =     keyspan_table
 };
 
-static int __init usb_keyspan_init(void)
-{
-       int result;
-
-       /* register this driver with the USB subsystem */
-       result = usb_register(&keyspan_driver);
-       if (result)
-               err("usb_register failed. Error number %d\n", result);
-
-       return result;
-}
-
-static void __exit usb_keyspan_exit(void)
-{
-       /* deregister this driver with the USB subsystem */
-       usb_deregister(&keyspan_driver);
-}
-
-module_init(usb_keyspan_init);
-module_exit(usb_keyspan_exit);
+module_usb_driver(keyspan_driver);
 
 MODULE_DEVICE_TABLE(usb, keyspan_table);
 MODULE_AUTHOR(DRIVER_AUTHOR);
index f45947190e4fcb07668adeec9734ea28418df481..538f7049ec644b553760bd37b6bb422d32bd0a10 100644 (file)
@@ -441,18 +441,7 @@ static struct usb_driver powermate_driver = {
         .id_table =     powermate_devices,
 };
 
-static int __init powermate_init(void)
-{
-       return usb_register(&powermate_driver);
-}
-
-static void __exit powermate_cleanup(void)
-{
-       usb_deregister(&powermate_driver);
-}
-
-module_init(powermate_init);
-module_exit(powermate_cleanup);
+module_usb_driver(powermate_driver);
 
 MODULE_AUTHOR( "William R Sowerbutts" );
 MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" );
index 41201c6b5e68aea509d37e8cbd7bb6f9f9acf2de..f4776e7f8c151ae62ec8e38c39d16ad0bec6c8e0 100644 (file)
@@ -988,22 +988,7 @@ static struct usb_driver yealink_driver = {
        .id_table       = usb_table,
 };
 
-static int __init yealink_dev_init(void)
-{
-       int ret = usb_register(&yealink_driver);
-       if (ret == 0)
-               printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
-                      DRIVER_DESC "\n");
-       return ret;
-}
-
-static void __exit yealink_dev_exit(void)
-{
-       usb_deregister(&yealink_driver);
-}
-
-module_init(yealink_dev_init);
-module_exit(yealink_dev_exit);
+module_usb_driver(yealink_driver);
 
 MODULE_DEVICE_TABLE (usb, usb_table);
 
index b77f9991278e791557e47638ce078b157cf52993..0acbc7d50d0587b64b124516786f75665849c039 100644 (file)
@@ -938,15 +938,4 @@ static struct usb_driver atp_driver = {
        .id_table       = atp_table,
 };
 
-static int __init atp_init(void)
-{
-       return usb_register(&atp_driver);
-}
-
-static void __exit atp_exit(void)
-{
-       usb_deregister(&atp_driver);
-}
-
-module_init(atp_init);
-module_exit(atp_exit);
+module_usb_driver(atp_driver);
index 5ec617e28f7ececfa02729beb5addfd085cae7cb..cf87f8b18e34479c14bbfe49d1ca95495ecf4a5d 100644 (file)
@@ -940,16 +940,4 @@ static struct usb_driver bcm5974_driver = {
        .supports_autosuspend   = 1,
 };
 
-static int __init bcm5974_init(void)
-{
-       return usb_register(&bcm5974_driver);
-}
-
-static void __exit bcm5974_exit(void)
-{
-       usb_deregister(&bcm5974_driver);
-}
-
-module_init(bcm5974_init);
-module_exit(bcm5974_exit);
-
+module_usb_driver(bcm5974_driver);
index d94f7e9aa997f13cbafba7739d59a234bf117726..f8b0b1df91382db9cb161d80ae4e2e7047e9c02d 100644 (file)
@@ -269,19 +269,4 @@ static struct usb_driver usb_acecad_driver = {
        .id_table =     usb_acecad_id_table,
 };
 
-static int __init usb_acecad_init(void)
-{
-       int result = usb_register(&usb_acecad_driver);
-       if (result == 0)
-               printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
-                      DRIVER_DESC "\n");
-       return result;
-}
-
-static void __exit usb_acecad_exit(void)
-{
-       usb_deregister(&usb_acecad_driver);
-}
-
-module_init(usb_acecad_init);
-module_exit(usb_acecad_exit);
+module_usb_driver(usb_acecad_driver);
index 6d89fd1842c32a9a577a6d7c424f00be3cfec340..d5ef3debd0455c8cb792e21e60bde573c37ce069 100644 (file)
@@ -1919,21 +1919,7 @@ static struct usb_driver aiptek_driver = {
        .id_table = aiptek_ids,
 };
 
-static int __init aiptek_init(void)
-{
-       int result = usb_register(&aiptek_driver);
-       if (result == 0) {
-               printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
-                      DRIVER_DESC "\n");
-               printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_AUTHOR "\n");
-       }
-       return result;
-}
-
-static void __exit aiptek_exit(void)
-{
-       usb_deregister(&aiptek_driver);
-}
+module_usb_driver(aiptek_driver);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
@@ -1943,6 +1929,3 @@ module_param(programmableDelay, int, 0);
 MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming");
 module_param(jitterDelay, int, 0);
 MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay");
-
-module_init(aiptek_init);
-module_exit(aiptek_exit);
index 8ea6afe2e9922021c73eaae9558e45dd28f74f0f..89a297801dce7e8d4c03abf98d851b898177f1ee 100644 (file)
@@ -1022,33 +1022,7 @@ static struct usb_driver gtco_driverinfo_table = {
        .disconnect     = gtco_disconnect,
 };
 
-/*
- *  Register this module with the USB subsystem
- */
-static int __init gtco_init(void)
-{
-       int error;
-
-       error = usb_register(&gtco_driverinfo_table);
-       if (error) {
-               err("usb_register() failed rc=0x%x", error);
-               return error;
-       }
-
-       printk("GTCO usb driver version: %s", GTCO_VERSION);
-       return 0;
-}
-
-/*
- *   Deregister this module with the USB subsystem
- */
-static void __exit gtco_exit(void)
-{
-       usb_deregister(&gtco_driverinfo_table);
-}
-
-module_init(gtco_init);
-module_exit(gtco_exit);
+module_usb_driver(gtco_driverinfo_table);
 
 MODULE_DESCRIPTION("GTCO digitizer USB driver");
 MODULE_LICENSE("GPL");
index 6504b627b234e009477623cfc41bb4b0ad4ce79f..b2db3cfe308468c506b791dae639d47a0312d051 100644 (file)
@@ -432,15 +432,4 @@ static struct usb_driver hanwang_driver = {
        .id_table       = hanwang_ids,
 };
 
-static int __init hanwang_init(void)
-{
-       return usb_register(&hanwang_driver);
-}
-
-static void __exit hanwang_exit(void)
-{
-       usb_deregister(&hanwang_driver);
-}
-
-module_init(hanwang_init);
-module_exit(hanwang_exit);
+module_usb_driver(hanwang_driver);
index 290f4e57b589a18f440d9d41f01f9c42e7798670..85a5b40333ac3a347e5d901ec9ac413306310bcb 100644 (file)
@@ -198,22 +198,4 @@ static struct usb_driver kbtab_driver = {
        .id_table =     kbtab_ids,
 };
 
-static int __init kbtab_init(void)
-{
-       int retval;
-       retval = usb_register(&kbtab_driver);
-       if (retval)
-               goto out;
-       printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
-              DRIVER_DESC "\n");
-out:
-       return retval;
-}
-
-static void __exit kbtab_exit(void)
-{
-       usb_deregister(&kbtab_driver);
-}
-
-module_init(kbtab_init);
-module_exit(kbtab_exit);
+module_usb_driver(kbtab_driver);
index 1c1b7b43cf923f728c697514fec2cc5afaa7cd31..8f9cde3e0ec21a2e6db96fe6ce998c72aac93035 100644 (file)
@@ -919,21 +919,4 @@ static struct usb_driver wacom_driver = {
        .supports_autosuspend = 1,
 };
 
-static int __init wacom_init(void)
-{
-       int result;
-
-       result = usb_register(&wacom_driver);
-       if (result == 0)
-               printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
-                      DRIVER_DESC "\n");
-       return result;
-}
-
-static void __exit wacom_exit(void)
-{
-       usb_deregister(&wacom_driver);
-}
-
-module_init(wacom_init);
-module_exit(wacom_exit);
+module_usb_driver(wacom_driver);
index 73fd6642b681b92a074b6e8ab2619b65768292f7..e539d92cc62674c6e72beb8d75dbd5f0a26f611c 100644 (file)
@@ -1580,18 +1580,7 @@ static struct usb_driver usbtouch_driver = {
        .supports_autosuspend = 1,
 };
 
-static int __init usbtouch_init(void)
-{
-       return usb_register(&usbtouch_driver);
-}
-
-static void __exit usbtouch_cleanup(void)
-{
-       usb_deregister(&usbtouch_driver);
-}
-
-module_init(usbtouch_init);
-module_exit(usbtouch_cleanup);
+module_usb_driver(usbtouch_driver);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);