Commit 871d3372 authored by Axel Lin's avatar Axel Lin Committed by David S. Miller

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: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f20f5a7
...@@ -1383,18 +1383,7 @@ static struct platform_driver at91_can_driver = { ...@@ -1383,18 +1383,7 @@ static struct platform_driver at91_can_driver = {
.id_table = at91_can_id_table, .id_table = at91_can_id_table,
}; };
static int __init at91_can_module_init(void) module_platform_driver(at91_can_driver);
{
return platform_driver_register(&at91_can_driver);
}
static void __exit at91_can_module_exit(void)
{
platform_driver_unregister(&at91_can_driver);
}
module_init(at91_can_module_init);
module_exit(at91_can_module_exit);
MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>"); MODULE_AUTHOR("Marc Kleine-Budde <mkl@pengutronix.de>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
......
...@@ -676,17 +676,7 @@ static struct platform_driver bfin_can_driver = { ...@@ -676,17 +676,7 @@ static struct platform_driver bfin_can_driver = {
}, },
}; };
static int __init bfin_can_init(void) module_platform_driver(bfin_can_driver);
{
return platform_driver_register(&bfin_can_driver);
}
module_init(bfin_can_init);
static void __exit bfin_can_exit(void)
{
platform_driver_unregister(&bfin_can_driver);
}
module_exit(bfin_can_exit);
MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -197,17 +197,7 @@ static struct platform_driver c_can_plat_driver = { ...@@ -197,17 +197,7 @@ static struct platform_driver c_can_plat_driver = {
.remove = __devexit_p(c_can_plat_remove), .remove = __devexit_p(c_can_plat_remove),
}; };
static int __init c_can_plat_init(void) module_platform_driver(c_can_plat_driver);
{
return platform_driver_register(&c_can_plat_driver);
}
module_init(c_can_plat_init);
static void __exit c_can_plat_exit(void)
{
platform_driver_unregister(&c_can_plat_driver);
}
module_exit(c_can_plat_exit);
MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>"); MODULE_AUTHOR("Bhupesh Sharma <bhupesh.sharma@st.com>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
......
...@@ -1060,20 +1060,7 @@ static struct platform_driver flexcan_driver = { ...@@ -1060,20 +1060,7 @@ static struct platform_driver flexcan_driver = {
.remove = __devexit_p(flexcan_remove), .remove = __devexit_p(flexcan_remove),
}; };
static int __init flexcan_init(void) module_platform_driver(flexcan_driver);
{
pr_info("%s netdevice driver\n", DRV_NAME);
return platform_driver_register(&flexcan_driver);
}
static void __exit flexcan_exit(void)
{
platform_driver_unregister(&flexcan_driver);
pr_info("%s: driver removed\n", DRV_NAME);
}
module_init(flexcan_init);
module_exit(flexcan_exit);
MODULE_AUTHOR("Sascha Hauer <kernel@pengutronix.de>, " MODULE_AUTHOR("Sascha Hauer <kernel@pengutronix.de>, "
"Marc Kleine-Budde <kernel@pengutronix.de>"); "Marc Kleine-Budde <kernel@pengutronix.de>");
......
...@@ -1803,20 +1803,9 @@ static struct platform_driver ican3_driver = { ...@@ -1803,20 +1803,9 @@ static struct platform_driver ican3_driver = {
.remove = __devexit_p(ican3_remove), .remove = __devexit_p(ican3_remove),
}; };
static int __init ican3_init(void) module_platform_driver(ican3_driver);
{
return platform_driver_register(&ican3_driver);
}
static void __exit ican3_exit(void)
{
platform_driver_unregister(&ican3_driver);
}
MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>"); MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver"); MODULE_DESCRIPTION("Janz MODULbus VMOD-ICAN3 Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:janz-ican3"); MODULE_ALIAS("platform:janz-ican3");
module_init(ican3_init);
module_exit(ican3_exit);
...@@ -411,17 +411,7 @@ static struct platform_driver mpc5xxx_can_driver = { ...@@ -411,17 +411,7 @@ static struct platform_driver mpc5xxx_can_driver = {
#endif #endif
}; };
static int __init mpc5xxx_can_init(void) module_platform_driver(mpc5xxx_can_driver);
{
return platform_driver_register(&mpc5xxx_can_driver);
}
module_init(mpc5xxx_can_init);
static void __exit mpc5xxx_can_exit(void)
{
platform_driver_unregister(&mpc5xxx_can_driver);
};
module_exit(mpc5xxx_can_exit);
MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
MODULE_DESCRIPTION("Freescale MPC5xxx CAN driver"); MODULE_DESCRIPTION("Freescale MPC5xxx CAN driver");
......
...@@ -220,14 +220,4 @@ static struct platform_driver sja1000_ofp_driver = { ...@@ -220,14 +220,4 @@ static struct platform_driver sja1000_ofp_driver = {
.remove = __devexit_p(sja1000_ofp_remove), .remove = __devexit_p(sja1000_ofp_remove),
}; };
static int __init sja1000_ofp_init(void) module_platform_driver(sja1000_ofp_driver);
{
return platform_driver_register(&sja1000_ofp_driver);
}
module_init(sja1000_ofp_init);
static void __exit sja1000_ofp_exit(void)
{
return platform_driver_unregister(&sja1000_ofp_driver);
};
module_exit(sja1000_ofp_exit);
...@@ -185,15 +185,4 @@ static struct platform_driver sp_driver = { ...@@ -185,15 +185,4 @@ static struct platform_driver sp_driver = {
}, },
}; };
static int __init sp_init(void) module_platform_driver(sp_driver);
{
return platform_driver_register(&sp_driver);
}
static void __exit sp_exit(void)
{
platform_driver_unregister(&sp_driver);
}
module_init(sp_init);
module_exit(sp_exit);
...@@ -874,21 +874,9 @@ static struct platform_driver softing_driver = { ...@@ -874,21 +874,9 @@ static struct platform_driver softing_driver = {
.remove = __devexit_p(softing_pdev_remove), .remove = __devexit_p(softing_pdev_remove),
}; };
MODULE_ALIAS("platform:softing"); module_platform_driver(softing_driver);
static int __init softing_start(void)
{
return platform_driver_register(&softing_driver);
}
static void __exit softing_stop(void)
{
platform_driver_unregister(&softing_driver);
}
module_init(softing_start);
module_exit(softing_stop);
MODULE_ALIAS("platform:softing");
MODULE_DESCRIPTION("Softing DPRAM CAN driver"); MODULE_DESCRIPTION("Softing DPRAM CAN driver");
MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>"); MODULE_AUTHOR("Kurt Van Dijck <kurt.van.dijck@eia.be>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -1037,20 +1037,7 @@ static struct platform_driver ti_hecc_driver = { ...@@ -1037,20 +1037,7 @@ static struct platform_driver ti_hecc_driver = {
.resume = ti_hecc_resume, .resume = ti_hecc_resume,
}; };
static int __init ti_hecc_init_driver(void) module_platform_driver(ti_hecc_driver);
{
printk(KERN_INFO DRV_DESC "\n");
return platform_driver_register(&ti_hecc_driver);
}
static void __exit ti_hecc_exit_driver(void)
{
printk(KERN_INFO DRV_DESC " unloaded\n");
platform_driver_unregister(&ti_hecc_driver);
}
module_exit(ti_hecc_exit_driver);
module_init(ti_hecc_init_driver);
MODULE_AUTHOR("Anant Gole <anantgole@ti.com>"); MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
......
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