netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: davinci_mdio: Use of_mdiobus_register()
@ 2014-05-06 15:18 Daniel Mack
  2014-05-06 16:42 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Mack @ 2014-05-06 15:18 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: davem, netdev, Daniel Mack

of_mdiobus_register() calls mdiobus_register() internally, so the
functionality is preserved. However, by calling the of_ variant, phy
nodes can be augmented with extra information.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/net/ethernet/ti/davinci_mdio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 0cca9de..359d42c 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -38,6 +38,7 @@
 #include <linux/davinci_emac.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_mdio.h>
 #include <linux/pinctrl/consumer.h>
 
 /*
@@ -389,7 +390,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
 	}
 
 	/* register the mii bus */
-	ret = mdiobus_register(data->bus);
+	ret = of_mdiobus_register(data->bus, dev->of_node);
 	if (ret)
 		goto bail_out;
 
-- 
1.9.0

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

* Re: [PATCH] net: davinci_mdio: Use of_mdiobus_register()
  2014-05-06 15:18 [PATCH] net: davinci_mdio: Use of_mdiobus_register() Daniel Mack
@ 2014-05-06 16:42 ` Florian Fainelli
  2014-05-06 16:51   ` Daniel Mack
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2014-05-06 16:42 UTC (permalink / raw)
  To: Daniel Mack; +Cc: mugunthanvnm, David Miller, netdev

Hi,

2014-05-06 8:18 GMT-07:00 Daniel Mack <zonque@gmail.com>:
> of_mdiobus_register() calls mdiobus_register() internally, so the
> functionality is preserved. However, by calling the of_ variant, phy
> nodes can be augmented with extra information.

Are there any non Device Tree aware platforms using this driver?
of_mdiobus_register() is an empty stub returning -ENOSYS when
CONFIG_OF is not set, maybe we should make it return
mdiobus_register() instead...

>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  drivers/net/ethernet/ti/davinci_mdio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
> index 0cca9de..359d42c 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -38,6 +38,7 @@
>  #include <linux/davinci_emac.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> +#include <linux/of_mdio.h>
>  #include <linux/pinctrl/consumer.h>
>
>  /*
> @@ -389,7 +390,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
>         }
>
>         /* register the mii bus */
> -       ret = mdiobus_register(data->bus);
> +       ret = of_mdiobus_register(data->bus, dev->of_node);
>         if (ret)
>                 goto bail_out;
>
> --
> 1.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Florian

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

* Re: [PATCH] net: davinci_mdio: Use of_mdiobus_register()
  2014-05-06 16:42 ` Florian Fainelli
@ 2014-05-06 16:51   ` Daniel Mack
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2014-05-06 16:51 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: mugunthanvnm, David Miller, netdev

On 05/06/2014 06:42 PM, Florian Fainelli wrote:
> 2014-05-06 8:18 GMT-07:00 Daniel Mack <zonque@gmail.com>:
>> of_mdiobus_register() calls mdiobus_register() internally, so the
>> functionality is preserved. However, by calling the of_ variant, phy
>> nodes can be augmented with extra information.
> 
> Are there any non Device Tree aware platforms using this driver?
> of_mdiobus_register() is an empty stub returning -ENOSYS when
> CONFIG_OF is not set, maybe we should make it return
> mdiobus_register() instead...

Ah, good point. Yes, what you propose seems like a valid fix. I'll send
a patch for that.


Thanks,
Daniel

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

end of thread, other threads:[~2014-05-06 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 15:18 [PATCH] net: davinci_mdio: Use of_mdiobus_register() Daniel Mack
2014-05-06 16:42 ` Florian Fainelli
2014-05-06 16:51   ` Daniel Mack

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