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 d728875..32bbd4c 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 8d345e8..874a51c 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 fc62256..d99151a 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 f459471..538f704 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 41201c6..f4776e7 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 b77f999..0acbc7d 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 5ec617e..cf87f8b 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 d94f7e9..f8b0b1d 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 6d89fd1..d5ef3de 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 8ea6afe..89a2978 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 6504b62..b2db3cf 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 290f4e5..85a5b40 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 1c1b7b4..8f9cde3 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 73fd664..e539d92 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);