diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-27 10:42:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-29 00:25:05 -0500 |
commit | 871d33725545ca2e402b4526f38f89d041ba930f (patch) | |
tree | fb52710f1208db2a85d8080c38038c58804c8487 /drivers/net/can | |
parent | 0f20f5a7de1ee48ced284e960828017cc2f5d52b (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/can')
-rw-r--r-- | drivers/net/can/at91_can.c | 13 | ||||
-rw-r--r-- | drivers/net/can/bfin_can.c | 12 | ||||
-rw-r--r-- | drivers/net/can/c_can/c_can_platform.c | 12 | ||||
-rw-r--r-- | drivers/net/can/flexcan.c | 15 | ||||
-rw-r--r-- | drivers/net/can/janz-ican3.c | 13 | ||||
-rw-r--r-- | drivers/net/can/mscan/mpc5xxx_can.c | 12 | ||||
-rw-r--r-- | drivers/net/can/sja1000/sja1000_of_platform.c | 12 | ||||
-rw-r--r-- | drivers/net/can/sja1000/sja1000_platform.c | 13 | ||||
-rw-r--r-- | drivers/net/can/softing/softing_main.c | 16 | ||||
-rw-r--r-- | drivers/net/can/ti_hecc.c | 15 |
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 | ||
1386 | static int __init at91_can_module_init(void) | 1386 | module_platform_driver(at91_can_driver); |
1387 | { | ||
1388 | return platform_driver_register(&at91_can_driver); | ||
1389 | } | ||
1390 | |||
1391 | static void __exit at91_can_module_exit(void) | ||
1392 | { | ||
1393 | platform_driver_unregister(&at91_can_driver); | ||
1394 | } | ||
1395 | |||
1396 | module_init(at91_can_module_init); | ||
1397 | module_exit(at91_can_module_exit); | ||
1398 | 1387 | ||
1399 | MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>"); | 1388 | MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>"); |
1400 | MODULE_LICENSE("GPL v2"); | 1389 | MODULE_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 | ||
679 | static int __init bfin_can_init(void) | 679 | module_platform_driver(bfin_can_driver); |
680 | { | ||
681 | return platform_driver_register(&bfin_can_driver); | ||
682 | } | ||
683 | module_init(bfin_can_init); | ||
684 | |||
685 | static void __exit bfin_can_exit(void) | ||
686 | { | ||
687 | platform_driver_unregister(&bfin_can_driver); | ||
688 | } | ||
689 | module_exit(bfin_can_exit); | ||
690 | 680 | ||
691 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 681 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
692 | MODULE_LICENSE("GPL"); | 682 | MODULE_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 | ||
200 | static int __init c_can_plat_init(void) | 200 | module_platform_driver(c_can_plat_driver); |
201 | { | ||
202 | return platform_driver_register(&c_can_plat_driver); | ||
203 | } | ||
204 | module_init(c_can_plat_init); | ||
205 | |||
206 | static void __exit c_can_plat_exit(void) | ||
207 | { | ||
208 | platform_driver_unregister(&c_can_plat_driver); | ||
209 | } | ||
210 | module_exit(c_can_plat_exit); | ||
211 | 201 | ||
212 | MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>"); | 202 | MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>"); |
213 | MODULE_LICENSE("GPL v2"); | 203 | MODULE_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 | ||
1063 | static int __init flexcan_init(void) | 1063 | module_platform_driver(flexcan_driver); |
1064 | { | ||
1065 | pr_info("%s netdevice driver\n", DRV_NAME); | ||
1066 | return platform_driver_register(&flexcan_driver); | ||
1067 | } | ||
1068 | |||
1069 | static void __exit flexcan_exit(void) | ||
1070 | { | ||
1071 | platform_driver_unregister(&flexcan_driver); | ||
1072 | pr_info("%s: driver removed\n", DRV_NAME); | ||
1073 | } | ||
1074 | |||
1075 | module_init(flexcan_init); | ||
1076 | module_exit(flexcan_exit); | ||
1077 | 1064 | ||
1078 | MODULE_AUTHOR("Sascha Hauer <kernel@pengutronix.de>, " | 1065 | MODULE_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 | ||
1806 | static int __init ican3_init(void) | 1806 | module_platform_driver(ican3_driver); |
1807 | { | ||
1808 | return platform_driver_register(&ican3_driver); | ||
1809 | } | ||
1810 | |||
1811 | static void __exit ican3_exit(void) | ||
1812 | { | ||
1813 | platform_driver_unregister(&ican3_driver); | ||
1814 | } | ||
1815 | 1807 | ||
1816 | MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); | 1808 | MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); |
1817 | MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver"); | 1809 | MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver"); |
1818 | MODULE_LICENSE("GPL"); | 1810 | MODULE_LICENSE("GPL"); |
1819 | MODULE_ALIAS("platform:janz-ican3"); | 1811 | MODULE_ALIAS("platform:janz-ican3"); |
1820 | |||
1821 | module_init(ican3_init); | ||
1822 | module_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 | ||
414 | static int __init mpc5xxx_can_init(void) | 414 | module_platform_driver(mpc5xxx_can_driver); |
415 | { | ||
416 | return platform_driver_register(&mpc5xxx_can_driver); | ||
417 | } | ||
418 | module_init(mpc5xxx_can_init); | ||
419 | |||
420 | static void __exit mpc5xxx_can_exit(void) | ||
421 | { | ||
422 | platform_driver_unregister(&mpc5xxx_can_driver); | ||
423 | }; | ||
424 | module_exit(mpc5xxx_can_exit); | ||
425 | 415 | ||
426 | MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); | 416 | MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); |
427 | MODULE_DESCRIPTION("Freescale MPC5xxx CAN driver"); | 417 | MODULE_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 | ||
223 | static int __init sja1000_ofp_init(void) | 223 | module_platform_driver(sja1000_ofp_driver); |
224 | { | ||
225 | return platform_driver_register(&sja1000_ofp_driver); | ||
226 | } | ||
227 | module_init(sja1000_ofp_init); | ||
228 | |||
229 | static void __exit sja1000_ofp_exit(void) | ||
230 | { | ||
231 | return platform_driver_unregister(&sja1000_ofp_driver); | ||
232 | }; | ||
233 | module_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 | ||
188 | static int __init sp_init(void) | 188 | module_platform_driver(sp_driver); |
189 | { | ||
190 | return platform_driver_register(&sp_driver); | ||
191 | } | ||
192 | |||
193 | static void __exit sp_exit(void) | ||
194 | { | ||
195 | platform_driver_unregister(&sp_driver); | ||
196 | } | ||
197 | |||
198 | module_init(sp_init); | ||
199 | module_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 | ||
877 | MODULE_ALIAS("platform:softing"); | 877 | module_platform_driver(softing_driver); |
878 | |||
879 | static int __init softing_start(void) | ||
880 | { | ||
881 | return platform_driver_register(&softing_driver); | ||
882 | } | ||
883 | |||
884 | static void __exit softing_stop(void) | ||
885 | { | ||
886 | platform_driver_unregister(&softing_driver); | ||
887 | } | ||
888 | |||
889 | module_init(softing_start); | ||
890 | module_exit(softing_stop); | ||
891 | 878 | ||
879 | MODULE_ALIAS("platform:softing"); | ||
892 | MODULE_DESCRIPTION("Softing DPRAM CAN driver"); | 880 | MODULE_DESCRIPTION("Softing DPRAM CAN driver"); |
893 | MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>"); | 881 | MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>"); |
894 | MODULE_LICENSE("GPL v2"); | 882 | MODULE_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 | ||
1040 | static int __init ti_hecc_init_driver(void) | 1040 | module_platform_driver(ti_hecc_driver); |
1041 | { | ||
1042 | printk(KERN_INFO DRV_DESC "\n"); | ||
1043 | return platform_driver_register(&ti_hecc_driver); | ||
1044 | } | ||
1045 | |||
1046 | static 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 | |||
1052 | module_exit(ti_hecc_exit_driver); | ||
1053 | module_init(ti_hecc_init_driver); | ||
1054 | 1041 | ||
1055 | MODULE_AUTHOR("Anant Gole <anantgole@ti.com>"); | 1042 | MODULE_AUTHOR("Anant Gole <anantgole@ti.com>"); |
1056 | MODULE_LICENSE("GPL v2"); | 1043 | MODULE_LICENSE("GPL v2"); |