USB: convert some miscellanies drivers to use module_usb_driver()

This converts the remaining USB drivers in the kernel 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: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Till Harbaum <till@harbaum.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jesper Juhl <jj@chaosbits.net>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: Jamie Iles <jamie@jamieiles.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2011-11-18 09:52:10 -08:00
parent 424f0750ed
commit fe7484834b
12 changed files with 12 additions and 216 deletions

View File

@ -515,20 +515,7 @@ static struct usb_driver diolan_u2c_driver = {
.id_table = diolan_u2c_table,
};
static int __init diolan_u2c_init(void)
{
/* register this driver with the USB subsystem */
return usb_register(&diolan_u2c_driver);
}
static void __exit diolan_u2c_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&diolan_u2c_driver);
}
module_init(diolan_u2c_init);
module_exit(diolan_u2c_exit);
module_usb_driver(diolan_u2c_driver);
MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>");
MODULE_DESCRIPTION(DRIVER_NAME " driver");

View File

@ -262,20 +262,7 @@ static struct usb_driver i2c_tiny_usb_driver = {
.id_table = i2c_tiny_usb_table,
};
static int __init usb_i2c_tiny_usb_init(void)
{
/* register this driver with the USB subsystem */
return usb_register(&i2c_tiny_usb_driver);
}
static void __exit usb_i2c_tiny_usb_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&i2c_tiny_usb_driver);
}
module_init(usb_i2c_tiny_usb_init);
module_exit(usb_i2c_tiny_usb_exit);
module_usb_driver(i2c_tiny_usb_driver);
/* ----- end of usb layer ------------------------------------------------ */

View File

@ -2154,30 +2154,4 @@ static struct usb_driver hfcsusb_drv = {
.disconnect = hfcsusb_disconnect,
};
static int __init
hfcsusb_init(void)
{
printk(KERN_INFO DRIVER_NAME " driver Rev. %s debug(0x%x) poll(%i)\n",
hfcsusb_rev, debug, poll);
if (usb_register(&hfcsusb_drv)) {
printk(KERN_INFO DRIVER_NAME
": Unable to register hfcsusb module at usb stack\n");
return -ENODEV;
}
return 0;
}
static void __exit
hfcsusb_cleanup(void)
{
if (debug & DBG_HFC_CALL_TRACE)
printk(KERN_INFO DRIVER_NAME ": %s\n", __func__);
/* unregister Hardware */
usb_deregister(&hfcsusb_drv); /* release our driver */
}
module_init(hfcsusb_init);
module_exit(hfcsusb_cleanup);
module_usb_driver(hfcsusb_drv);

View File

@ -562,17 +562,7 @@ static struct usb_driver ushc_driver = {
.disconnect = ushc_disconnect,
};
static int __init ushc_init(void)
{
return usb_register(&ushc_driver);
}
module_init(ushc_init);
static void __exit ushc_exit(void)
{
usb_deregister(&ushc_driver);
}
module_exit(ushc_exit);
module_usb_driver(ushc_driver);
MODULE_DESCRIPTION("USB SD Host Controller driver");
MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>");

View File

@ -717,17 +717,6 @@ static struct usb_driver alauda_driver = {
.id_table = alauda_table,
};
static int __init alauda_init(void)
{
return usb_register(&alauda_driver);
}
static void __exit alauda_exit(void)
{
usb_deregister(&alauda_driver);
}
module_init(alauda_init);
module_exit(alauda_exit);
module_usb_driver(alauda_driver);
MODULE_LICENSE("GPL");

View File

@ -1597,24 +1597,7 @@ static struct usb_driver pn533_driver = {
.id_table = pn533_table,
};
static int __init pn533_init(void)
{
int rc;
rc = usb_register(&pn533_driver);
if (rc)
err("usb_register failed. Error number %d", rc);
return rc;
}
static void __exit pn533_exit(void)
{
usb_deregister(&pn533_driver);
}
module_init(pn533_init);
module_exit(pn533_exit);
module_usb_driver(pn533_driver);
MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>,"
" Aloisio Almeida Jr <aloisio.almeida@openbossa.org>");

View File

@ -914,17 +914,7 @@ static struct usb_driver hwarc_driver = {
.post_reset = hwarc_post_reset,
};
static int __init hwarc_driver_init(void)
{
return usb_register(&hwarc_driver);
}
module_init(hwarc_driver_init);
static void __exit hwarc_driver_exit(void)
{
usb_deregister(&hwarc_driver);
}
module_exit(hwarc_driver_exit);
module_usb_driver(hwarc_driver);
MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver");

View File

@ -451,25 +451,7 @@ static struct usb_driver i1480_dfu_driver = {
.disconnect = NULL,
};
/*
* Initialize the i1480 DFU driver.
*
* We also need to register our function for guessing event sizes.
*/
static int __init i1480_dfu_driver_init(void)
{
return usb_register(&i1480_dfu_driver);
}
module_init(i1480_dfu_driver_init);
static void __exit i1480_dfu_driver_exit(void)
{
usb_deregister(&i1480_dfu_driver);
}
module_exit(i1480_dfu_driver_exit);
module_usb_driver(i1480_dfu_driver);
MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB");

View File

@ -1792,24 +1792,7 @@ static struct usb_driver ufx_driver = {
.id_table = id_table,
};
static int __init ufx_module_init(void)
{
int res;
res = usb_register(&ufx_driver);
if (res)
err("usb_register failed. Error number %d", res);
return res;
}
static void __exit ufx_module_exit(void)
{
usb_deregister(&ufx_driver);
}
module_init(ufx_module_init);
module_exit(ufx_module_exit);
module_usb_driver(ufx_driver);
static void ufx_urb_completion(struct urb *urb)
{

View File

@ -1761,24 +1761,7 @@ static struct usb_driver dlfb_driver = {
.id_table = id_table,
};
static int __init dlfb_module_init(void)
{
int res;
res = usb_register(&dlfb_driver);
if (res)
err("usb_register failed. Error number %d", res);
return res;
}
static void __exit dlfb_module_exit(void)
{
usb_deregister(&dlfb_driver);
}
module_init(dlfb_module_init);
module_exit(dlfb_module_exit);
module_usb_driver(dlfb_driver);
static void dlfb_urb_completion(struct urb *urb)
{

View File

@ -1002,26 +1002,7 @@ static void ds_disconnect(struct usb_interface *intf)
kfree(dev);
}
static int ds_init(void)
{
int err;
err = usb_register(&ds_driver);
if (err) {
printk(KERN_INFO "Failed to register DS9490R USB device: err=%d.\n", err);
return err;
}
return 0;
}
static void ds_fini(void)
{
usb_deregister(&ds_driver);
}
module_init(ds_init);
module_exit(ds_fini);
module_usb_driver(ds_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");

View File

@ -827,37 +827,4 @@ static void usb_pcwd_disconnect(struct usb_interface *interface)
printk(KERN_INFO PFX "USB PC Watchdog disconnected\n");
}
/**
* usb_pcwd_init
*/
static int __init usb_pcwd_init(void)
{
int result;
/* register this driver with the USB subsystem */
result = usb_register(&usb_pcwd_driver);
if (result) {
printk(KERN_ERR PFX "usb_register failed. Error number %d\n",
result);
return result;
}
printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION "\n");
return 0;
}
/**
* usb_pcwd_exit
*/
static void __exit usb_pcwd_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&usb_pcwd_driver);
}
module_init(usb_pcwd_init);
module_exit(usb_pcwd_exit);
module_usb_driver(usb_pcwd_driver);