[PATCH] drivers: net: davinci_mdio: use builtin_platform_driver
Subsystems:
networking drivers , the rest , ti ethernet switch driver (cpsw)
STALE3543d
3 messages,
3 authors,
2016-11-25 · open the first message on its own page
Use builtin_platform_driver() helper to simplify the code.
Signed-off-by: Geliang Tang <redacted>
---
drivers/net/ethernet/ti/davinci_mdio.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 33df340..b3f0a12 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -536,11 +536,7 @@ static struct platform_driver davinci_mdio_driver = {
. remove = davinci_mdio_remove ,
};
- static int __init davinci_mdio_init ( void )
- {
- return platform_driver_register ( & davinci_mdio_driver );
- }
- device_initcall ( davinci_mdio_init );
+ builtin_platform_driver ( davinci_mdio_driver );
static void __exit davinci_mdio_exit ( void )
{ --
2.9.3
On 11/23/2016 08:45 AM, Geliang Tang wrote: Use builtin_platform_driver() helper to simplify the code.
Not sure about this. We do support this driver to be a module.
quoted hunk
Signed-off-by: Geliang Tang <redacted>
---
drivers/net/ethernet/ti/davinci_mdio.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 33df340..b3f0a12 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c @@ -536,11 +536,7 @@ static struct platform_driver davinci_mdio_driver = {
. remove = davinci_mdio_remove ,
};
- static int __init davinci_mdio_init ( void )
- {
- return platform_driver_register ( & davinci_mdio_driver );
- }
- device_initcall ( davinci_mdio_init );
+ builtin_platform_driver ( davinci_mdio_driver );
static void __exit davinci_mdio_exit ( void )
{
--
regards,
-grygorii
From: Geliang Tang <redacted>
Date: Wed, 23 Nov 2016 22:45:43 +0800
quoted hunk @@ -536,11 +536,7 @@ static struct platform_driver davinci_mdio_driver = {
.remove = davinci_mdio_remove,
};
- static int __init davinci_mdio_init(void)
- {
- return platform_driver_register(&davinci_mdio_driver);
- }
- device_initcall(davinci_mdio_init);
+ builtin_platform_driver(davinci_mdio_driver);
As noted by others this is not a correct transformation, the existing
code works properly when modular. But it will not with this change.
device_initcall() is rerouted to module_init() inside of a module
build, whereas the thing builtin_platform_driver() expands to does
not.