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:
@@ -885,40 +885,7 @@ static struct usb_driver adu_driver = {
|
||||
.id_table = device_table,
|
||||
};
|
||||
|
||||
static int __init adu_init(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
dbg(2," %s : enter", __func__);
|
||||
|
||||
/* register this driver with the USB subsystem */
|
||||
result = usb_register(&adu_driver);
|
||||
if (result < 0) {
|
||||
printk(KERN_ERR "usb_register failed for the "__FILE__
|
||||
" driver. Error number %d\n", result);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "adutux " DRIVER_DESC " " DRIVER_VERSION "\n");
|
||||
printk(KERN_INFO "adutux is an experimental driver. "
|
||||
"Use at your own risk\n");
|
||||
|
||||
exit:
|
||||
dbg(2," %s : leave, return value %d", __func__, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void __exit adu_exit(void)
|
||||
{
|
||||
dbg(2," %s : enter", __func__);
|
||||
/* deregister this driver with the USB subsystem */
|
||||
usb_deregister(&adu_driver);
|
||||
dbg(2," %s : leave", __func__);
|
||||
}
|
||||
|
||||
module_init(adu_init);
|
||||
module_exit(adu_exit);
|
||||
module_usb_driver(adu_driver);
|
||||
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
|
Reference in New Issue
Block a user