Commit d632eb1b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: convert drivers/net/* to use module_usb_driver()

This converts the drivers in drivers/net/* 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: Wolfgang Grandegger <wg@grandegger.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Oliver Neukum <oliver@neukum.name>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Petko Manolov <petkan@users.sourceforge.net>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: Herton Ronaldo Krzesinski <herton@canonical.com>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Chaoming Li <chaoming_li@realsil.com.cn>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: Pavel Roskin <proski@gnu.org>
Cc: Yoann DI-RUZZA <y.diruzza@lim.eu>
Cc: George <george0505@realtek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bac2c126
...@@ -1115,28 +1115,4 @@ static struct usb_driver ems_usb_driver = { ...@@ -1115,28 +1115,4 @@ static struct usb_driver ems_usb_driver = {
.id_table = ems_usb_table, .id_table = ems_usb_table,
}; };
static int __init ems_usb_init(void) module_usb_driver(ems_usb_driver);
{
int err;
printk(KERN_INFO "CPC-USB kernel driver loaded\n");
/* register this driver with the USB subsystem */
err = usb_register(&ems_usb_driver);
if (err) {
err("usb_register failed. Error number %d\n", err);
return err;
}
return 0;
}
static void __exit ems_usb_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&ems_usb_driver);
}
module_init(ems_usb_init);
module_exit(ems_usb_exit);
...@@ -1108,25 +1108,4 @@ static struct usb_driver esd_usb2_driver = { ...@@ -1108,25 +1108,4 @@ static struct usb_driver esd_usb2_driver = {
.id_table = esd_usb2_table, .id_table = esd_usb2_table,
}; };
static int __init esd_usb2_init(void) module_usb_driver(esd_usb2_driver);
{
int err;
/* register this driver with the USB subsystem */
err = usb_register(&esd_usb2_driver);
if (err) {
err("usb_register failed. Error number %d\n", err);
return err;
}
return 0;
}
module_init(esd_usb2_init);
static void __exit esd_usb2_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&esd_usb2_driver);
}
module_exit(esd_usb2_exit);
...@@ -1914,41 +1914,8 @@ static struct usb_driver irda_driver = { ...@@ -1914,41 +1914,8 @@ static struct usb_driver irda_driver = {
#endif #endif
}; };
/************************* MODULE CALLBACKS *************************/ module_usb_driver(irda_driver);
/*
* Deal with module insertion/removal
* Mostly tell USB about our existence
*/
/*------------------------------------------------------------------*/
/*
* Module insertion
*/
static int __init usb_irda_init(void)
{
int ret;
ret = usb_register(&irda_driver);
if (ret < 0)
return ret;
IRDA_MESSAGE("USB IrDA support registered\n");
return 0;
}
module_init(usb_irda_init);
/*------------------------------------------------------------------*/
/*
* Module removal
*/
static void __exit usb_irda_cleanup(void)
{
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(usb_irda_cleanup);
/*------------------------------------------------------------------*/
/* /*
* Module parameters * Module parameters
*/ */
......
...@@ -621,24 +621,7 @@ static struct usb_driver irda_driver = { ...@@ -621,24 +621,7 @@ static struct usb_driver irda_driver = {
#endif #endif
}; };
/* module_usb_driver(irda_driver);
* Module insertion
*/
static int __init kingsun_init(void)
{
return usb_register(&irda_driver);
}
module_init(kingsun_init);
/*
* Module removal
*/
static void __exit kingsun_cleanup(void)
{
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(kingsun_cleanup);
MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine");
......
...@@ -901,26 +901,7 @@ static struct usb_driver irda_driver = { ...@@ -901,26 +901,7 @@ static struct usb_driver irda_driver = {
#endif #endif
}; };
/* module_usb_driver(irda_driver);
* Module insertion
*/
static int __init ks959_init(void)
{
return usb_register(&irda_driver);
}
module_init(ks959_init);
/*
* Module removal
*/
static void __exit ks959_cleanup(void)
{
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(ks959_cleanup);
MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959");
......
...@@ -796,26 +796,7 @@ static struct usb_driver irda_driver = { ...@@ -796,26 +796,7 @@ static struct usb_driver irda_driver = {
#endif #endif
}; };
/* module_usb_driver(irda_driver);
* Module insertion
*/
static int __init ksdazzle_init(void)
{
return usb_register(&irda_driver);
}
module_init(ksdazzle_init);
/*
* Module removal
*/
static void __exit ksdazzle_cleanup(void)
{
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(ksdazzle_cleanup);
MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>");
MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle");
......
...@@ -968,25 +968,4 @@ static void mcs_disconnect(struct usb_interface *intf) ...@@ -968,25 +968,4 @@ static void mcs_disconnect(struct usb_interface *intf)
IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); IRDA_DEBUG(0, "MCS7780 now disconnected.\n");
} }
/* Module insertion */ module_usb_driver(mcs_driver);
static int __init mcs_init(void)
{
int result;
/* register this driver with the USB subsystem */
result = usb_register(&mcs_driver);
if (result)
IRDA_ERROR("usb_register failed. Error number %d\n", result);
return result;
}
module_init(mcs_init);
/* Module removal */
static void __exit mcs_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&mcs_driver);
}
module_exit(mcs_exit);
...@@ -1133,21 +1133,4 @@ static struct usb_driver irda_driver = { ...@@ -1133,21 +1133,4 @@ static struct usb_driver irda_driver = {
#endif #endif
}; };
/* module_usb_driver(irda_driver);
* Module insertion
*/
static int __init stir_init(void)
{
return usb_register(&irda_driver);
}
module_init(stir_init);
/*
* Module removal
*/
static void __exit stir_cleanup(void)
{
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(stir_cleanup);
...@@ -1634,17 +1634,7 @@ static struct usb_driver asix_driver = { ...@@ -1634,17 +1634,7 @@ static struct usb_driver asix_driver = {
.supports_autosuspend = 1, .supports_autosuspend = 1,
}; };
static int __init asix_init(void) module_usb_driver(asix_driver);
{
return usb_register(&asix_driver);
}
module_init(asix_init);
static void __exit asix_exit(void)
{
usb_deregister(&asix_driver);
}
module_exit(asix_exit);
MODULE_AUTHOR("David Hollis"); MODULE_AUTHOR("David Hollis");
MODULE_VERSION(DRIVER_VERSION); MODULE_VERSION(DRIVER_VERSION);
......
...@@ -949,19 +949,4 @@ static struct usb_driver catc_driver = { ...@@ -949,19 +949,4 @@ static struct usb_driver catc_driver = {
.id_table = catc_id_table, .id_table = catc_id_table,
}; };
static int __init catc_init(void) module_usb_driver(catc_driver);
{
int result = usb_register(&catc_driver);
if (result == 0)
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
DRIVER_DESC "\n");
return result;
}
static void __exit catc_exit(void)
{
usb_deregister(&catc_driver);
}
module_init(catc_init);
module_exit(catc_exit);
...@@ -457,18 +457,7 @@ static struct usb_driver usbpn_driver = { ...@@ -457,18 +457,7 @@ static struct usb_driver usbpn_driver = {
.id_table = usbpn_ids, .id_table = usbpn_ids,
}; };
static int __init usbpn_init(void) module_usb_driver(usbpn_driver);
{
return usb_register(&usbpn_driver);
}
static void __exit usbpn_exit(void)
{
usb_deregister(&usbpn_driver);
}
module_init(usbpn_init);
module_exit(usbpn_exit);
MODULE_AUTHOR("Remi Denis-Courmont"); MODULE_AUTHOR("Remi Denis-Courmont");
MODULE_DESCRIPTION("USB CDC Phonet host interface"); MODULE_DESCRIPTION("USB CDC Phonet host interface");
......
...@@ -369,18 +369,7 @@ static struct usb_driver eem_driver = { ...@@ -369,18 +369,7 @@ static struct usb_driver eem_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
module_usb_driver(eem_driver);
static int __init eem_init(void)
{
return usb_register(&eem_driver);
}
module_init(eem_init);
static void __exit eem_exit(void)
{
usb_deregister(&eem_driver);
}
module_exit(eem_exit);
MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>"); MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>");
MODULE_DESCRIPTION("USB CDC EEM"); MODULE_DESCRIPTION("USB CDC EEM");
......
...@@ -425,6 +425,9 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -425,6 +425,9 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
int status; int status;
struct cdc_state *info = (void *) &dev->data; struct cdc_state *info = (void *) &dev->data;
BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
< sizeof(struct cdc_state)));
status = usbnet_generic_cdc_bind(dev, intf); status = usbnet_generic_cdc_bind(dev, intf);
if (status < 0) if (status < 0)
return status; return status;
...@@ -615,21 +618,7 @@ static struct usb_driver cdc_driver = { ...@@ -615,21 +618,7 @@ static struct usb_driver cdc_driver = {
.supports_autosuspend = 1, .supports_autosuspend = 1,
}; };
module_usb_driver(cdc_driver);
static int __init cdc_init(void)
{
BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
< sizeof(struct cdc_state)));
return usb_register(&cdc_driver);
}
module_init(cdc_init);
static void __exit cdc_exit(void)
{
usb_deregister(&cdc_driver);
}
module_exit(cdc_exit);
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("USB CDC Ethernet devices"); MODULE_DESCRIPTION("USB CDC Ethernet devices");
......
...@@ -1232,20 +1232,7 @@ static struct ethtool_ops cdc_ncm_ethtool_ops = { ...@@ -1232,20 +1232,7 @@ static struct ethtool_ops cdc_ncm_ethtool_ops = {
.nway_reset = usbnet_nway_reset, .nway_reset = usbnet_nway_reset,
}; };
static int __init cdc_ncm_init(void) module_usb_driver(cdc_ncm_driver);
{
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION "\n");
return usb_register(&cdc_ncm_driver);
}
module_init(cdc_ncm_init);
static void __exit cdc_ncm_exit(void)
{
usb_deregister(&cdc_ncm_driver);
}
module_exit(cdc_ncm_exit);
MODULE_AUTHOR("Hans Petter Selasky"); MODULE_AUTHOR("Hans Petter Selasky");
MODULE_DESCRIPTION("USB CDC NCM host driver"); MODULE_DESCRIPTION("USB CDC NCM host driver");
......
...@@ -338,17 +338,7 @@ static struct usb_driver cdc_subset_driver = { ...@@ -338,17 +338,7 @@ static struct usb_driver cdc_subset_driver = {
.id_table = products, .id_table = products,
}; };
static int __init cdc_subset_init(void) module_usb_driver(cdc_subset_driver);
{
return usb_register(&cdc_subset_driver);
}
module_init(cdc_subset_init);
static void __exit cdc_subset_exit(void)
{
usb_deregister(&cdc_subset_driver);
}
module_exit(cdc_subset_exit);
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links"); MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links");
......
...@@ -329,17 +329,7 @@ static struct usb_driver cx82310_driver = { ...@@ -329,17 +329,7 @@ static struct usb_driver cx82310_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init cx82310_init(void) module_usb_driver(cx82310_driver);
{
return usb_register(&cx82310_driver);
}
module_init(cx82310_init);
static void __exit cx82310_exit(void)
{
usb_deregister(&cx82310_driver);
}
module_exit(cx82310_exit);
MODULE_AUTHOR("Ondrej Zary"); MODULE_AUTHOR("Ondrej Zary");
MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver"); MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver");
......
...@@ -672,18 +672,7 @@ static struct usb_driver dm9601_driver = { ...@@ -672,18 +672,7 @@ static struct usb_driver dm9601_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init dm9601_init(void) module_usb_driver(dm9601_driver);
{
return usb_register(&dm9601_driver);
}
static void __exit dm9601_exit(void)
{
usb_deregister(&dm9601_driver);
}
module_init(dm9601_init);
module_exit(dm9601_exit);
MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices"); MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices");
......
...@@ -227,17 +227,7 @@ static struct usb_driver gl620a_driver = { ...@@ -227,17 +227,7 @@ static struct usb_driver gl620a_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init usbnet_init(void) module_usb_driver(gl620a_driver);
{
return usb_register(&gl620a_driver);
}
module_init(usbnet_init);
static void __exit usbnet_exit(void)
{
usb_deregister(&gl620a_driver);
}
module_exit(usbnet_exit);
MODULE_AUTHOR("Jiun-Jie Huang"); MODULE_AUTHOR("Jiun-Jie Huang");
MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables"); MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables");
......
...@@ -238,17 +238,7 @@ static struct usb_driver int51x1_driver = { ...@@ -238,17 +238,7 @@ static struct usb_driver int51x1_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init int51x1_init(void) module_usb_driver(int51x1_driver);
{
return usb_register(&int51x1_driver);
}
module_init(int51x1_init);
static void __exit int51x1_exit(void)
{
usb_deregister(&int51x1_driver);
}
module_exit(int51x1_exit);
MODULE_AUTHOR("Peter Holik"); MODULE_AUTHOR("Peter Holik");
MODULE_DESCRIPTION("Intellon usb powerline adapter"); MODULE_DESCRIPTION("Intellon usb powerline adapter");
......
...@@ -543,25 +543,7 @@ static struct usb_driver ipheth_driver = { ...@@ -543,25 +543,7 @@ static struct usb_driver ipheth_driver = {
.id_table = ipheth_table, .id_table = ipheth_table,
}; };
static int __init ipheth_init(void) module_usb_driver(ipheth_driver);
{
int retval;
retval = usb_register(&ipheth_driver);
if (retval) {
err("usb_register failed: %d", retval);
return retval;
}
return 0;
}
static void __exit ipheth_exit(void)
{
usb_deregister(&ipheth_driver);
}
module_init(ipheth_init);
module_exit(ipheth_exit);
MODULE_AUTHOR("Diego Giagio <diego@giagio.com>"); MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver"); MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
......
...@@ -375,17 +375,7 @@ static struct usb_driver kalmia_driver = { ...@@ -375,17 +375,7 @@ static struct usb_driver kalmia_driver = {
.resume = usbnet_resume .resume = usbnet_resume
}; };
static int __init kalmia_init(void) module_usb_driver(kalmia_driver);
{
return usb_register(&kalmia_driver);
}
module_init( kalmia_init);
static void __exit kalmia_exit(void)
{
usb_deregister(&kalmia_driver);
}
module_exit( kalmia_exit);
MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>"); MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>");
MODULE_DESCRIPTION("Samsung Kalmia USB network driver"); MODULE_DESCRIPTION("Samsung Kalmia USB network driver");
......
...@@ -1324,32 +1324,4 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev, ...@@ -1324,32 +1324,4 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
} }
} }
module_usb_driver(kaweth_driver);
/****************************************************************
* kaweth_init
****************************************************************/
static int __init kaweth_init(void)
{
dbg("Driver loading");
return usb_register(&kaweth_driver);
}
/****************************************************************
* kaweth_exit
****************************************************************/
static void __exit kaweth_exit(void)
{
usb_deregister(&kaweth_driver);
}
module_init(kaweth_init);
module_exit(kaweth_exit);
...@@ -349,17 +349,7 @@ static struct usb_driver lg_vl600_driver = { ...@@ -349,17 +349,7 @@ static struct usb_driver lg_vl600_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init vl600_init(void) module_usb_driver(lg_vl600_driver);
{
return usb_register(&lg_vl600_driver);
}
module_init(vl600_init);
static void __exit vl600_exit(void)
{
usb_deregister(&lg_vl600_driver);
}
module_exit(vl600_exit);
MODULE_AUTHOR("Anrzej Zaborowski"); MODULE_AUTHOR("Anrzej Zaborowski");
MODULE_DESCRIPTION("LG-VL600 modem's ethernet link"); MODULE_DESCRIPTION("LG-VL600 modem's ethernet link");
......
...@@ -692,17 +692,7 @@ static struct usb_driver mcs7830_driver = { ...@@ -692,17 +692,7 @@ static struct usb_driver mcs7830_driver = {
.reset_resume = mcs7830_reset_resume, .reset_resume = mcs7830_reset_resume,
}; };
static int __init mcs7830_init(void) module_usb_driver(mcs7830_driver);
{
return usb_register(&mcs7830_driver);
}
module_init(mcs7830_init);
static void __exit mcs7830_exit(void)
{
usb_deregister(&mcs7830_driver);
}
module_exit(mcs7830_exit);
MODULE_DESCRIPTION("USB to network adapter MCS7830)"); MODULE_DESCRIPTION("USB to network adapter MCS7830)");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -589,17 +589,7 @@ static struct usb_driver net1080_driver = { ...@@ -589,17 +589,7 @@ static struct usb_driver net1080_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init net1080_init(void) module_usb_driver(net1080_driver);
{
return usb_register(&net1080_driver);
}
module_init(net1080_init);
static void __exit net1080_exit(void)
{
usb_deregister(&net1080_driver);
}
module_exit(net1080_exit);
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links"); MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links");
......
...@@ -154,17 +154,7 @@ static struct usb_driver plusb_driver = { ...@@ -154,17 +154,7 @@ static struct usb_driver plusb_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init plusb_init(void) module_usb_driver(plusb_driver);
{
return usb_register(&plusb_driver);
}
module_init(plusb_init);
static void __exit plusb_exit(void)
{
usb_deregister(&plusb_driver);
}
module_exit(plusb_exit);
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver"); MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver");
......
...@@ -635,17 +635,7 @@ static struct usb_driver rndis_driver = { ...@@ -635,17 +635,7 @@ static struct usb_driver rndis_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init rndis_init(void) module_usb_driver(rndis_driver);
{
return usb_register(&rndis_driver);
}
module_init(rndis_init);
static void __exit rndis_exit(void)
{
usb_deregister(&rndis_driver);
}
module_exit(rndis_exit);
MODULE_AUTHOR("David Brownell"); MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("USB Host side RNDIS driver"); MODULE_DESCRIPTION("USB Host side RNDIS driver");
......
...@@ -978,20 +978,7 @@ static struct usb_driver rtl8150_driver = { ...@@ -978,20 +978,7 @@ static struct usb_driver rtl8150_driver = {
.resume = rtl8150_resume .resume = rtl8150_resume
}; };
static int __init usb_rtl8150_init(void) module_usb_driver(rtl8150_driver);
{
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
DRIVER_DESC "\n");
return usb_register(&rtl8150_driver);
}
static void __exit usb_rtl8150_exit(void)
{
usb_deregister(&rtl8150_driver);
}
module_init(usb_rtl8150_init);
module_exit(usb_rtl8150_exit);
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC); MODULE_DESCRIPTION(DRIVER_DESC);
......
...@@ -900,6 +900,9 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, ...@@ -900,6 +900,9 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
u16 len; u16 len;
bool need_tail; bool need_tail;
BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
< sizeof(struct cdc_state));
dev_dbg(&dev->udev->dev, "%s", __func__); dev_dbg(&dev->udev->dev, "%s", __func__);
if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) { if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) {
/* enough head room as is? */ /* enough head room as is? */
...@@ -981,21 +984,7 @@ static struct usb_driver sierra_net_driver = { ...@@ -981,21 +984,7 @@ static struct usb_driver sierra_net_driver = {
.no_dynamic_id = 1, .no_dynamic_id = 1,
}; };
static int __init sierra_net_init(void) module_usb_driver(sierra_net_driver);
{
BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data)
< sizeof(struct cdc_state));
return usb_register(&sierra_net_driver);
}
static void __exit sierra_net_exit(void)
{
usb_deregister(&sierra_net_driver);
}
module_exit(sierra_net_exit);
module_init(sierra_net_init);
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC); MODULE_DESCRIPTION(DRIVER_DESC);
......
...@@ -1236,17 +1236,7 @@ static struct usb_driver smsc75xx_driver = { ...@@ -1236,17 +1236,7 @@ static struct usb_driver smsc75xx_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
}; };
static int __init smsc75xx_init(void) module_usb_driver(smsc75xx_driver);
{
return usb_register(&smsc75xx_driver);
}
module_init(smsc75xx_init);
static void __exit smsc75xx_exit(void)
{
usb_deregister(&smsc75xx_driver);
}
module_exit(smsc75xx_exit);
MODULE_AUTHOR("Nancy Lin"); MODULE_AUTHOR("Nancy Lin");
MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
......
...@@ -1297,17 +1297,7 @@ static struct usb_driver smsc95xx_driver = { ...@@ -1297,17 +1297,7 @@ static struct usb_driver smsc95xx_driver = {
.disconnect = usbnet_disconnect, .disconnect = usbnet_disconnect,
}; };
static int __init smsc95xx_init(void) module_usb_driver(smsc95xx_driver);
{
return usb_register(&smsc95xx_driver);
}
module_init(smsc95xx_init);
static void __exit smsc95xx_exit(void)
{
usb_deregister(&smsc95xx_driver);
}
module_exit(smsc95xx_exit);
MODULE_AUTHOR("Nancy Lin"); MODULE_AUTHOR("Nancy Lin");
MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>");
......
...@@ -362,17 +362,7 @@ static struct usb_driver zaurus_driver = { ...@@ -362,17 +362,7 @@ static struct usb_driver zaurus_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init zaurus_init(void) module_usb_driver(zaurus_driver);
{
return usb_register(&zaurus_driver);
}
module_init(zaurus_init);
static void __exit zaurus_exit(void)
{
usb_deregister(&zaurus_driver);
}
module_exit(zaurus_exit);
MODULE_AUTHOR("Pavel Machek, David Brownell"); MODULE_AUTHOR("Pavel Machek, David Brownell");
MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products"); MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products");
......
...@@ -1161,15 +1161,4 @@ static struct usb_driver carl9170_driver = { ...@@ -1161,15 +1161,4 @@ static struct usb_driver carl9170_driver = {
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
}; };
static int __init carl9170_usb_init(void) module_usb_driver(carl9170_driver);
{
return usb_register(&carl9170_driver);
}
static void __exit carl9170_usb_exit(void)
{
usb_deregister(&carl9170_driver);
}
module_init(carl9170_usb_init);
module_exit(carl9170_usb_exit);
...@@ -1184,29 +1184,7 @@ static struct usb_driver if_usb_driver = { ...@@ -1184,29 +1184,7 @@ static struct usb_driver if_usb_driver = {
.reset_resume = if_usb_resume, .reset_resume = if_usb_resume,
}; };
static int __init if_usb_init_module(void) module_usb_driver(if_usb_driver);
{
int ret = 0;
lbs_deb_enter(LBS_DEB_MAIN);
ret = usb_register(&if_usb_driver);
lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
return ret;
}
static void __exit if_usb_exit_module(void)
{
lbs_deb_enter(LBS_DEB_MAIN);
usb_deregister(&if_usb_driver);
lbs_deb_leave(LBS_DEB_MAIN);
}
module_init(if_usb_init_module);
module_exit(if_usb_exit_module);
MODULE_DESCRIPTION("8388 USB WLAN Driver"); MODULE_DESCRIPTION("8388 USB WLAN Driver");
MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc."); MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc.");
......
...@@ -924,27 +924,7 @@ static struct usb_driver if_usb_driver = { ...@@ -924,27 +924,7 @@ static struct usb_driver if_usb_driver = {
.resume = if_usb_resume, .resume = if_usb_resume,
}; };
static int __init if_usb_init_module(void) module_usb_driver(if_usb_driver);
{
int ret = 0;
lbtf_deb_enter(LBTF_DEB_MAIN);
ret = usb_register(&if_usb_driver);
lbtf_deb_leave_args(LBTF_DEB_MAIN, "ret %d", ret);
return ret;
}
static void __exit if_usb_exit_module(void)
{
lbtf_deb_enter(LBTF_DEB_MAIN);
usb_deregister(&if_usb_driver);
lbtf_deb_leave(LBTF_DEB_MAIN);
}
module_init(if_usb_init_module);
module_exit(if_usb_exit_module);
MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver"); MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver");
MODULE_AUTHOR("Cozybit Inc."); MODULE_AUTHOR("Cozybit Inc.");
......
...@@ -1759,32 +1759,7 @@ static struct usb_driver orinoco_driver = { ...@@ -1759,32 +1759,7 @@ static struct usb_driver orinoco_driver = {
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
" (Manuel Estrada Sainz)"; " (Manuel Estrada Sainz)";
static int __init ezusb_module_init(void) module_usb_driver(orinoco_driver);
{
int err;
printk(KERN_DEBUG "%s\n", version);
/* register this driver with the USB subsystem */
err = usb_register(&orinoco_driver);
if (err < 0) {
printk(KERN_ERR PFX "usb_register failed, error %d\n",
err);
return err;
}
return 0;
}
static void __exit ezusb_module_exit(void)
{
/* deregister this driver with the USB subsystem */
usb_deregister(&orinoco_driver);
}
module_init(ezusb_module_init);
module_exit(ezusb_module_exit);
MODULE_AUTHOR("Manuel Estrada Sainz"); MODULE_AUTHOR("Manuel Estrada Sainz");
MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge"); MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge");
......
...@@ -1083,15 +1083,4 @@ static struct usb_driver p54u_driver = { ...@@ -1083,15 +1083,4 @@ static struct usb_driver p54u_driver = {
.soft_unbind = 1, .soft_unbind = 1,
}; };
static int __init p54u_init(void) module_usb_driver(p54u_driver);
{
return usb_register(&p54u_driver);
}
static void __exit p54u_exit(void)
{
usb_deregister(&p54u_driver);
}
module_init(p54u_init);
module_exit(p54u_exit);
...@@ -3754,17 +3754,7 @@ static struct usb_driver rndis_wlan_driver = { ...@@ -3754,17 +3754,7 @@ static struct usb_driver rndis_wlan_driver = {
.resume = usbnet_resume, .resume = usbnet_resume,
}; };
static int __init rndis_wlan_init(void) module_usb_driver(rndis_wlan_driver);
{
return usb_register(&rndis_wlan_driver);
}
module_init(rndis_wlan_init);
static void __exit rndis_wlan_exit(void)
{
usb_deregister(&rndis_wlan_driver);
}
module_exit(rndis_wlan_exit);
MODULE_AUTHOR("Bjorge Dijkstra"); MODULE_AUTHOR("Bjorge Dijkstra");
MODULE_AUTHOR("Jussi Kivilinna"); MODULE_AUTHOR("Jussi Kivilinna");
......
...@@ -1982,15 +1982,4 @@ static struct usb_driver rt2500usb_driver = { ...@@ -1982,15 +1982,4 @@ static struct usb_driver rt2500usb_driver = {
.resume = rt2x00usb_resume, .resume = rt2x00usb_resume,
}; };
static int __init rt2500usb_init(void) module_usb_driver(rt2500usb_driver);
{
return usb_register(&rt2500usb_driver);
}
static void __exit rt2500usb_exit(void)
{
usb_deregister(&rt2500usb_driver);
}
module_init(rt2500usb_init);
module_exit(rt2500usb_exit);
...@@ -1233,15 +1233,4 @@ static struct usb_driver rt2800usb_driver = { ...@@ -1233,15 +1233,4 @@ static struct usb_driver rt2800usb_driver = {
.resume = rt2x00usb_resume, .resume = rt2x00usb_resume,
}; };
static int __init rt2800usb_init(void) module_usb_driver(rt2800usb_driver);
{
return usb_register(&rt2800usb_driver);
}
static void __exit rt2800usb_exit(void)
{
usb_deregister(&rt2800usb_driver);
}
module_init(rt2800usb_init);
module_exit(rt2800usb_exit);
...@@ -2528,15 +2528,4 @@ static struct usb_driver rt73usb_driver = { ...@@ -2528,15 +2528,4 @@ static struct usb_driver rt73usb_driver = {
.resume = rt2x00usb_resume, .resume = rt2x00usb_resume,
}; };
static int __init rt73usb_init(void) module_usb_driver(rt73usb_driver);
{
return usb_register(&rt73usb_driver);
}
static void __exit rt73usb_exit(void)
{
usb_deregister(&rt73usb_driver);
}
module_init(rt73usb_init);
module_exit(rt73usb_exit);
...@@ -1592,15 +1592,4 @@ static struct usb_driver rtl8187_driver = { ...@@ -1592,15 +1592,4 @@ static struct usb_driver rtl8187_driver = {
.disconnect = __devexit_p(rtl8187_disconnect), .disconnect = __devexit_p(rtl8187_disconnect),
}; };
static int __init rtl8187_init(void) module_usb_driver(rtl8187_driver);
{
return usb_register(&rtl8187_driver);
}
static void __exit rtl8187_exit(void)
{
usb_deregister(&rtl8187_driver);
}
module_init(rtl8187_init);
module_exit(rtl8187_exit);
...@@ -356,15 +356,4 @@ static struct usb_driver rtl8192cu_driver = { ...@@ -356,15 +356,4 @@ static struct usb_driver rtl8192cu_driver = {
#endif #endif
}; };
static int __init rtl8192cu_init(void) module_usb_driver(rtl8192cu_driver);
{
return usb_register(&rtl8192cu_driver);
}
static void __exit rtl8192cu_exit(void)
{
usb_deregister(&rtl8192cu_driver);
}
module_init(rtl8192cu_init);
module_exit(rtl8192cu_exit);
...@@ -1907,15 +1907,4 @@ static struct usb_driver zd1201_usb = { ...@@ -1907,15 +1907,4 @@ static struct usb_driver zd1201_usb = {
.resume = zd1201_resume, .resume = zd1201_resume,
}; };
static int __init zd1201_init(void) module_usb_driver(zd1201_usb);
{
return usb_register(&zd1201_usb);
}
static void __exit zd1201_cleanup(void)
{
usb_deregister(&zd1201_usb);
}
module_init(zd1201_init);
module_exit(zd1201_cleanup);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment