aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-11-27 10:42:31 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-29 00:25:05 -0500
commit871d33725545ca2e402b4526f38f89d041ba930f (patch)
treefb52710f1208db2a85d8080c38038c58804c8487 /drivers/net
parent0f20f5a7de1ee48ced284e960828017cc2f5d52b (diff)
net/can: convert drivers/net/can/* to use module_platform_driver()
This patch converts the drivers in drivers/net/can/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Bhupesh Sharma <bhupesh.sharma@st.com> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Anatolij Gustschin <agust@denx.de> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: Kurt Van Dijck <kurt.van.dijck@eia.be> Cc: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/at91_can.c13
-rw-r--r--drivers/net/can/bfin_can.c12
-rw-r--r--drivers/net/can/c_can/c_can_platform.c12
-rw-r--r--drivers/net/can/flexcan.c15
-rw-r--r--drivers/net/can/janz-ican3.c13
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c12
-rw-r--r--drivers/net/can/sja1000/sja1000_of_platform.c12
-rw-r--r--drivers/net/can/sja1000/sja1000_platform.c13
-rw-r--r--drivers/net/can/softing/softing_main.c16
-rw-r--r--drivers/net/can/ti_hecc.c15
10 files changed, 11 insertions, 122 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 044ea0647b04..6ea905c2cf6d 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1383,18 +1383,7 @@ static struct platform_driver at91_can_driver = {
1383 .id_table = at91_can_id_table, 1383 .id_table = at91_can_id_table,
1384}; 1384};
1385 1385
1386static int __init at91_can_module_init(void) 1386module_platform_driver(at91_can_driver);
1387{
1388 return platform_driver_register(&at91_can_driver);
1389}
1390
1391static void __exit at91_can_module_exit(void)
1392{
1393 platform_driver_unregister(&at91_can_driver);
1394}
1395
1396module_init(at91_can_module_init);
1397module_exit(at91_can_module_exit);
1398 1387
1399MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>"); 1388MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>");
1400MODULE_LICENSE("GPL v2"); 1389MODULE_LICENSE("GPL v2");
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index a1c5abc38cd2..349e0fabb63a 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -676,17 +676,7 @@ static struct platform_driver bfin_can_driver = {
676 }, 676 },
677}; 677};
678 678
679static int __init bfin_can_init(void) 679module_platform_driver(bfin_can_driver);
680{
681 return platform_driver_register(&bfin_can_driver);
682}
683module_init(bfin_can_init);
684
685static void __exit bfin_can_exit(void)
686{
687 platform_driver_unregister(&bfin_can_driver);
688}
689module_exit(bfin_can_exit);
690 680
691MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); 681MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
692MODULE_LICENSE("GPL"); 682MODULE_LICENSE("GPL");
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 0b5c6f8bdd34..5e1a5ff6476e 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -197,17 +197,7 @@ static struct platform_driver c_can_plat_driver = {
197 .remove = __devexit_p(c_can_plat_remove), 197 .remove = __devexit_p(c_can_plat_remove),
198}; 198};
199 199
200static int __init c_can_plat_init(void) 200module_platform_driver(c_can_plat_driver);
201{
202 return platform_driver_register(&c_can_plat_driver);
203}
204module_init(c_can_plat_init);
205
206static void __exit c_can_plat_exit(void)
207{
208 platform_driver_unregister(&c_can_plat_driver);
209}
210module_exit(c_can_plat_exit);
211 201
212MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>"); 202MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>");
213MODULE_LICENSE("GPL v2"); 203MODULE_LICENSE("GPL v2");
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index e02337953f41..165a4c798025 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1060,20 +1060,7 @@ static struct platform_driver flexcan_driver = {
1060 .remove = __devexit_p(flexcan_remove), 1060 .remove = __devexit_p(flexcan_remove),
1061}; 1061};
1062 1062
1063static int __init flexcan_init(void) 1063module_platform_driver(flexcan_driver);
1064{
1065 pr_info("%s netdevice driver\n", DRV_NAME);
1066 return platform_driver_register(&flexcan_driver);
1067}
1068
1069static void __exit flexcan_exit(void)
1070{
1071 platform_driver_unregister(&flexcan_driver);
1072 pr_info("%s: driver removed\n", DRV_NAME);
1073}
1074
1075module_init(flexcan_init);
1076module_exit(flexcan_exit);
1077 1064
1078MODULE_AUTHOR("Sascha Hauer <kernel@pengutronix.de>, " 1065MODULE_AUTHOR("Sascha Hauer <kernel@pengutronix.de>, "
1079 "Marc Kleine-Budde <kernel@pengutronix.de>"); 1066 "Marc Kleine-Budde <kernel@pengutronix.de>");
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 32778d56d330..08c893cb7896 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1803,20 +1803,9 @@ static struct platform_driver ican3_driver = {
1803 .remove = __devexit_p(ican3_remove), 1803 .remove = __devexit_p(ican3_remove),
1804}; 1804};
1805 1805
1806static int __init ican3_init(void) 1806module_platform_driver(ican3_driver);
1807{
1808 return platform_driver_register(&ican3_driver);
1809}
1810
1811static void __exit ican3_exit(void)
1812{
1813 platform_driver_unregister(&ican3_driver);
1814}
1815 1807
1816MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); 1808MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
1817MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver"); 1809MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver");
1818MODULE_LICENSE("GPL"); 1810MODULE_LICENSE("GPL");
1819MODULE_ALIAS("platform:janz-ican3"); 1811MODULE_ALIAS("platform:janz-ican3");
1820
1821module_init(ican3_init);
1822module_exit(ican3_exit);
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 5fedc3375562..5caa572d71e3 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -411,17 +411,7 @@ static struct platform_driver mpc5xxx_can_driver = {
411#endif 411#endif
412}; 412};
413 413
414static int __init mpc5xxx_can_init(void) 414module_platform_driver(mpc5xxx_can_driver);
415{
416 return platform_driver_register(&mpc5xxx_can_driver);
417}
418module_init(mpc5xxx_can_init);
419
420static void __exit mpc5xxx_can_exit(void)
421{
422 platform_driver_unregister(&mpc5xxx_can_driver);
423};
424module_exit(mpc5xxx_can_exit);
425 415
426MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); 416MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
427MODULE_DESCRIPTION("Freescale MPC5xxx CAN driver"); 417MODULE_DESCRIPTION("Freescale MPC5xxx CAN driver");
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index c3dd9d09be57..f2683eb6a3d5 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -220,14 +220,4 @@ static struct platform_driver sja1000_ofp_driver = {
220 .remove = __devexit_p(sja1000_ofp_remove), 220 .remove = __devexit_p(sja1000_ofp_remove),
221}; 221};
222 222
223static int __init sja1000_ofp_init(void) 223module_platform_driver(sja1000_ofp_driver);
224{
225 return platform_driver_register(&sja1000_ofp_driver);
226}
227module_init(sja1000_ofp_init);
228
229static void __exit sja1000_ofp_exit(void)
230{
231 return platform_driver_unregister(&sja1000_ofp_driver);
232};
233module_exit(sja1000_ofp_exit);
diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
index d9fadc489b32..4f50145f6483 100644
--- a/drivers/net/can/sja1000/sja1000_platform.c
+++ b/drivers/net/can/sja1000/sja1000_platform.c
@@ -185,15 +185,4 @@ static struct platform_driver sp_driver = {
185 }, 185 },
186}; 186};
187 187
188static int __init sp_init(void) 188module_platform_driver(sp_driver);
189{
190 return platform_driver_register(&sp_driver);
191}
192
193static void __exit sp_exit(void)
194{
195 platform_driver_unregister(&sp_driver);
196}
197
198module_init(sp_init);
199module_exit(sp_exit);
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 09a8b86cf1ac..a7c77c744ee9 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -874,21 +874,9 @@ static struct platform_driver softing_driver = {
874 .remove = __devexit_p(softing_pdev_remove), 874 .remove = __devexit_p(softing_pdev_remove),
875}; 875};
876 876
877MODULE_ALIAS("platform:softing"); 877module_platform_driver(softing_driver);
878
879static int __init softing_start(void)
880{
881 return platform_driver_register(&softing_driver);
882}
883
884static void __exit softing_stop(void)
885{
886 platform_driver_unregister(&softing_driver);
887}
888
889module_init(softing_start);
890module_exit(softing_stop);
891 878
879MODULE_ALIAS("platform:softing");
892MODULE_DESCRIPTION("Softing DPRAM CAN driver"); 880MODULE_DESCRIPTION("Softing DPRAM CAN driver");
893MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>"); 881MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>");
894MODULE_LICENSE("GPL v2"); 882MODULE_LICENSE("GPL v2");
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 2adc294f512a..df809e3f130e 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -1037,20 +1037,7 @@ static struct platform_driver ti_hecc_driver = {
1037 .resume = ti_hecc_resume, 1037 .resume = ti_hecc_resume,
1038}; 1038};
1039 1039
1040static int __init ti_hecc_init_driver(void) 1040module_platform_driver(ti_hecc_driver);
1041{
1042 printk(KERN_INFO DRV_DESC "\n");
1043 return platform_driver_register(&ti_hecc_driver);
1044}
1045
1046static void __exit ti_hecc_exit_driver(void)
1047{
1048 printk(KERN_INFO DRV_DESC " unloaded\n");
1049 platform_driver_unregister(&ti_hecc_driver);
1050}
1051
1052module_exit(ti_hecc_exit_driver);
1053module_init(ti_hecc_init_driver);
1054 1041
1055MODULE_AUTHOR("Anant Gole <anantgole@ti.com>"); 1042MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
1056MODULE_LICENSE("GPL v2"); 1043MODULE_LICENSE("GPL v2");