diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 12:44:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-18 12:44:20 -0500 |
commit | d632eb1bf22e11def74e4e53cc47d790fbdba105 (patch) | |
tree | 3cc5f929264ac1c3cffd9646f8ebdaf4e5a9fd33 /drivers/net/irda | |
parent | bac2c126e452eb00f91305ba2c04a8b2bd95acf0 (diff) |
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r-- | drivers/net/irda/irda-usb.c | 35 | ||||
-rw-r--r-- | drivers/net/irda/kingsun-sir.c | 19 | ||||
-rw-r--r-- | drivers/net/irda/ks959-sir.c | 21 | ||||
-rw-r--r-- | drivers/net/irda/ksdazzle-sir.c | 21 | ||||
-rw-r--r-- | drivers/net/irda/mcs7780.c | 23 | ||||
-rw-r--r-- | drivers/net/irda/stir4200.c | 19 |
6 files changed, 6 insertions, 132 deletions
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index d9267cb98a23..72f687b40d66 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1914,41 +1914,8 @@ static struct usb_driver irda_driver = { | |||
1914 | #endif | 1914 | #endif |
1915 | }; | 1915 | }; |
1916 | 1916 | ||
1917 | /************************* MODULE CALLBACKS *************************/ | 1917 | module_usb_driver(irda_driver); |
1918 | /* | ||
1919 | * Deal with module insertion/removal | ||
1920 | * Mostly tell USB about our existence | ||
1921 | */ | ||
1922 | |||
1923 | /*------------------------------------------------------------------*/ | ||
1924 | /* | ||
1925 | * Module insertion | ||
1926 | */ | ||
1927 | static int __init usb_irda_init(void) | ||
1928 | { | ||
1929 | int ret; | ||
1930 | |||
1931 | ret = usb_register(&irda_driver); | ||
1932 | if (ret < 0) | ||
1933 | return ret; | ||
1934 | |||
1935 | IRDA_MESSAGE("USB IrDA support registered\n"); | ||
1936 | return 0; | ||
1937 | } | ||
1938 | module_init(usb_irda_init); | ||
1939 | 1918 | ||
1940 | /*------------------------------------------------------------------*/ | ||
1941 | /* | ||
1942 | * Module removal | ||
1943 | */ | ||
1944 | static void __exit usb_irda_cleanup(void) | ||
1945 | { | ||
1946 | /* Deregister the driver and remove all pending instances */ | ||
1947 | usb_deregister(&irda_driver); | ||
1948 | } | ||
1949 | module_exit(usb_irda_cleanup); | ||
1950 | |||
1951 | /*------------------------------------------------------------------*/ | ||
1952 | /* | 1919 | /* |
1953 | * Module parameters | 1920 | * Module parameters |
1954 | */ | 1921 | */ |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index cb90d640007a..79aebeee928c 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -621,24 +621,7 @@ static struct usb_driver irda_driver = { | |||
621 | #endif | 621 | #endif |
622 | }; | 622 | }; |
623 | 623 | ||
624 | /* | 624 | module_usb_driver(irda_driver); |
625 | * Module insertion | ||
626 | */ | ||
627 | static int __init kingsun_init(void) | ||
628 | { | ||
629 | return usb_register(&irda_driver); | ||
630 | } | ||
631 | module_init(kingsun_init); | ||
632 | |||
633 | /* | ||
634 | * Module removal | ||
635 | */ | ||
636 | static void __exit kingsun_cleanup(void) | ||
637 | { | ||
638 | /* Deregister the driver and remove all pending instances */ | ||
639 | usb_deregister(&irda_driver); | ||
640 | } | ||
641 | module_exit(kingsun_cleanup); | ||
642 | 625 | ||
643 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); | 626 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); |
644 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); | 627 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 1046014dd6c2..abe689dffc72 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -901,26 +901,7 @@ static struct usb_driver irda_driver = { | |||
901 | #endif | 901 | #endif |
902 | }; | 902 | }; |
903 | 903 | ||
904 | /* | 904 | module_usb_driver(irda_driver); |
905 | * Module insertion | ||
906 | */ | ||
907 | static int __init ks959_init(void) | ||
908 | { | ||
909 | return usb_register(&irda_driver); | ||
910 | } | ||
911 | |||
912 | module_init(ks959_init); | ||
913 | |||
914 | /* | ||
915 | * Module removal | ||
916 | */ | ||
917 | static void __exit ks959_cleanup(void) | ||
918 | { | ||
919 | /* Deregister the driver and remove all pending instances */ | ||
920 | usb_deregister(&irda_driver); | ||
921 | } | ||
922 | |||
923 | module_exit(ks959_cleanup); | ||
924 | 905 | ||
925 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); | 906 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); |
926 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); | 907 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 9cc142fcc712..f8c01088eeb7 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -796,26 +796,7 @@ static struct usb_driver irda_driver = { | |||
796 | #endif | 796 | #endif |
797 | }; | 797 | }; |
798 | 798 | ||
799 | /* | 799 | module_usb_driver(irda_driver); |
800 | * Module insertion | ||
801 | */ | ||
802 | static int __init ksdazzle_init(void) | ||
803 | { | ||
804 | return usb_register(&irda_driver); | ||
805 | } | ||
806 | |||
807 | module_init(ksdazzle_init); | ||
808 | |||
809 | /* | ||
810 | * Module removal | ||
811 | */ | ||
812 | static void __exit ksdazzle_cleanup(void) | ||
813 | { | ||
814 | /* Deregister the driver and remove all pending instances */ | ||
815 | usb_deregister(&irda_driver); | ||
816 | } | ||
817 | |||
818 | module_exit(ksdazzle_cleanup); | ||
819 | 800 | ||
820 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); | 801 | MODULE_AUTHOR("Alex Villacís Lasso <a_villacis@palosanto.com>"); |
821 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); | 802 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index be52bfed66a9..1a00b5990cb8 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -968,25 +968,4 @@ static void mcs_disconnect(struct usb_interface *intf) | |||
968 | IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); | 968 | IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); |
969 | } | 969 | } |
970 | 970 | ||
971 | /* Module insertion */ | 971 | module_usb_driver(mcs_driver); |
972 | static int __init mcs_init(void) | ||
973 | { | ||
974 | int result; | ||
975 | |||
976 | /* register this driver with the USB subsystem */ | ||
977 | result = usb_register(&mcs_driver); | ||
978 | if (result) | ||
979 | IRDA_ERROR("usb_register failed. Error number %d\n", result); | ||
980 | |||
981 | return result; | ||
982 | } | ||
983 | module_init(mcs_init); | ||
984 | |||
985 | /* Module removal */ | ||
986 | static void __exit mcs_exit(void) | ||
987 | { | ||
988 | /* deregister this driver with the USB subsystem */ | ||
989 | usb_deregister(&mcs_driver); | ||
990 | } | ||
991 | module_exit(mcs_exit); | ||
992 | |||
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 41c96b3d8152..212868eb6f5f 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -1133,21 +1133,4 @@ static struct usb_driver irda_driver = { | |||
1133 | #endif | 1133 | #endif |
1134 | }; | 1134 | }; |
1135 | 1135 | ||
1136 | /* | 1136 | module_usb_driver(irda_driver); |
1137 | * Module insertion | ||
1138 | */ | ||
1139 | static int __init stir_init(void) | ||
1140 | { | ||
1141 | return usb_register(&irda_driver); | ||
1142 | } | ||
1143 | module_init(stir_init); | ||
1144 | |||
1145 | /* | ||
1146 | * Module removal | ||
1147 | */ | ||
1148 | static void __exit stir_cleanup(void) | ||
1149 | { | ||
1150 | /* Deregister the driver and remove all pending instances */ | ||
1151 | usb_deregister(&irda_driver); | ||
1152 | } | ||
1153 | module_exit(stir_cleanup); | ||