diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 12:34:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 12:34:02 -0500 |
commit | 65db43054065790a75291b0834657445fea2cf56 (patch) | |
tree | 000b010ed36dc99c4695178a6cb8a797a3d24865 /drivers/usb/class | |
parent | f3a6a4b6cfc80e57bf16bb12f9425bec1a5731a9 (diff) |
USB: convert drivers/usb/* to use module_usb_driver()
This converts the drivers in drivers/usb/* 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: Simon Arlott <cxacru@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Juergen Stuber <starblue@users.sourceforge.net>
Cc: Cesar Miquel <miquel@df.uba.ar>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Michael Hund <mhund@ld-didactic.de>
Cc: Zack Parsons <k3bacon@gmail.com>
Cc: Melchior FRANZ <mfranz@aon.at>
Cc: Tomoki Sekiyama <tomoki.sekiyama@gmail.com>
Cc: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 19 | ||||
-rw-r--r-- | drivers/usb/class/usblp.c | 13 | ||||
-rw-r--r-- | drivers/usb/class/usbtmc.c | 17 |
3 files changed, 3 insertions, 46 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index efe684908c1f..1c50baff7725 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -895,24 +895,7 @@ static struct usb_driver wdm_driver = { | |||
895 | .supports_autosuspend = 1, | 895 | .supports_autosuspend = 1, |
896 | }; | 896 | }; |
897 | 897 | ||
898 | /* --- low level module stuff --- */ | 898 | module_usb_driver(wdm_driver); |
899 | |||
900 | static int __init wdm_init(void) | ||
901 | { | ||
902 | int rv; | ||
903 | |||
904 | rv = usb_register(&wdm_driver); | ||
905 | |||
906 | return rv; | ||
907 | } | ||
908 | |||
909 | static void __exit wdm_exit(void) | ||
910 | { | ||
911 | usb_deregister(&wdm_driver); | ||
912 | } | ||
913 | |||
914 | module_init(wdm_init); | ||
915 | module_exit(wdm_exit); | ||
916 | 899 | ||
917 | MODULE_AUTHOR(DRIVER_AUTHOR); | 900 | MODULE_AUTHOR(DRIVER_AUTHOR); |
918 | MODULE_DESCRIPTION(DRIVER_DESC); | 901 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index cb3a93243a05..81ef2e207a8d 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1412,18 +1412,7 @@ static struct usb_driver usblp_driver = { | |||
1412 | .supports_autosuspend = 1, | 1412 | .supports_autosuspend = 1, |
1413 | }; | 1413 | }; |
1414 | 1414 | ||
1415 | static int __init usblp_init(void) | 1415 | module_usb_driver(usblp_driver); |
1416 | { | ||
1417 | return usb_register(&usblp_driver); | ||
1418 | } | ||
1419 | |||
1420 | static void __exit usblp_exit(void) | ||
1421 | { | ||
1422 | usb_deregister(&usblp_driver); | ||
1423 | } | ||
1424 | |||
1425 | module_init(usblp_init); | ||
1426 | module_exit(usblp_exit); | ||
1427 | 1416 | ||
1428 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1417 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1429 | MODULE_DESCRIPTION(DRIVER_DESC); | 1418 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 12cf5e7395a8..70d69d06054f 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -1116,21 +1116,6 @@ static struct usb_driver usbtmc_driver = { | |||
1116 | .resume = usbtmc_resume, | 1116 | .resume = usbtmc_resume, |
1117 | }; | 1117 | }; |
1118 | 1118 | ||
1119 | static int __init usbtmc_init(void) | 1119 | module_usb_driver(usbtmc_driver); |
1120 | { | ||
1121 | int retcode; | ||
1122 | |||
1123 | retcode = usb_register(&usbtmc_driver); | ||
1124 | if (retcode) | ||
1125 | printk(KERN_ERR KBUILD_MODNAME": Unable to register driver\n"); | ||
1126 | return retcode; | ||
1127 | } | ||
1128 | module_init(usbtmc_init); | ||
1129 | |||
1130 | static void __exit usbtmc_exit(void) | ||
1131 | { | ||
1132 | usb_deregister(&usbtmc_driver); | ||
1133 | } | ||
1134 | module_exit(usbtmc_exit); | ||
1135 | 1120 | ||
1136 | MODULE_LICENSE("GPL"); | 1121 | MODULE_LICENSE("GPL"); |