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>
This commit is contained in:
@@ -1372,18 +1372,7 @@ static struct usb_driver cxacru_usb_driver = {
|
||||
.id_table = cxacru_usb_ids
|
||||
};
|
||||
|
||||
static int __init cxacru_init(void)
|
||||
{
|
||||
return usb_register(&cxacru_usb_driver);
|
||||
}
|
||||
|
||||
static void __exit cxacru_cleanup(void)
|
||||
{
|
||||
usb_deregister(&cxacru_usb_driver);
|
||||
}
|
||||
|
||||
module_init(cxacru_init);
|
||||
module_exit(cxacru_cleanup);
|
||||
module_usb_driver(cxacru_usb_driver);
|
||||
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
|
@@ -953,22 +953,7 @@ static int speedtch_usb_probe(struct usb_interface *intf, const struct usb_devic
|
||||
return usbatm_usb_probe(intf, id, &speedtch_usbatm_driver);
|
||||
}
|
||||
|
||||
static int __init speedtch_usb_init(void)
|
||||
{
|
||||
dbg("%s: driver version %s", __func__, DRIVER_VERSION);
|
||||
|
||||
return usb_register(&speedtch_usb_driver);
|
||||
}
|
||||
|
||||
static void __exit speedtch_usb_cleanup(void)
|
||||
{
|
||||
dbg("%s", __func__);
|
||||
|
||||
usb_deregister(&speedtch_usb_driver);
|
||||
}
|
||||
|
||||
module_init(speedtch_usb_init);
|
||||
module_exit(speedtch_usb_cleanup);
|
||||
module_usb_driver(speedtch_usb_driver);
|
||||
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
|
@@ -2753,36 +2753,7 @@ static struct usb_driver uea_driver = {
|
||||
|
||||
MODULE_DEVICE_TABLE(usb, uea_ids);
|
||||
|
||||
/**
|
||||
* uea_init - Initialize the module.
|
||||
* Register to USB subsystem
|
||||
*/
|
||||
static int __init uea_init(void)
|
||||
{
|
||||
printk(KERN_INFO "[ueagle-atm] driver " EAGLEUSBVERSION " loaded\n");
|
||||
|
||||
usb_register(&uea_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(uea_init);
|
||||
|
||||
/**
|
||||
* uea_exit - Destroy module
|
||||
* Deregister with USB subsystem
|
||||
*/
|
||||
static void __exit uea_exit(void)
|
||||
{
|
||||
/*
|
||||
* This calls automatically the uea_disconnect method if necessary:
|
||||
*/
|
||||
usb_deregister(&uea_driver);
|
||||
|
||||
printk(KERN_INFO "[ueagle-atm] driver unloaded\n");
|
||||
}
|
||||
|
||||
module_exit(uea_exit);
|
||||
module_usb_driver(uea_driver);
|
||||
|
||||
MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka");
|
||||
MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver");
|
||||
|
Viittaa uudesa ongelmassa
Block a user