linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver
@ 2016-11-23 14:45 Geliang Tang
  2016-11-23 17:22 ` Grygorii Strashko
  2016-11-25 21:23 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2016-11-23 14:45 UTC (permalink / raw)
  To: Mugunthan V N, Grygorii Strashko
  Cc: Geliang Tang, linux-omap, netdev, linux-kernel

Use builtin_platform_driver() helper to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver
  2016-11-23 14:45 [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver Geliang Tang
@ 2016-11-23 17:22 ` Grygorii Strashko
  2016-11-25 21:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Grygorii Strashko @ 2016-11-23 17:22 UTC (permalink / raw)
  To: Geliang Tang, Mugunthan V N; +Cc: linux-omap, netdev, linux-kernel



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.

>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver
  2016-11-23 14:45 [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver Geliang Tang
  2016-11-23 17:22 ` Grygorii Strashko
@ 2016-11-25 21:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-25 21:23 UTC (permalink / raw)
  To: geliangtang
  Cc: mugunthanvnm, grygorii.strashko, linux-omap, netdev, linux-kernel

From: Geliang Tang <geliangtang@gmail.com>
Date: Wed, 23 Nov 2016 22:45:43 +0800

> @@ -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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-25 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-23 14:45 [PATCH] drivers: net: davinci_mdio: use builtin_platform_driver Geliang Tang
2016-11-23 17:22 ` Grygorii Strashko
2016-11-25 21:23 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).