netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF
@ 2014-05-06 16:52 Daniel Mack
  2014-05-06 17:06 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Mack @ 2014-05-06 16:52 UTC (permalink / raw)
  To: f.fainelli; +Cc: mugunthanvnm, davem, netdev, Daniel Mack

If CONFIG_OF is not set, make of_mdiobus_register() call
mdiobus_register() instead of returning -ENOSYS.

This way, we can just call of_mdiobus_register() from all DT-enabled
drivers to handle the compat cases.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/of_mdio.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 6fe8464..881a7c3 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -31,7 +31,12 @@ extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
 #else /* CONFIG_OF */
 static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 {
-	return -ENOSYS;
+	/*
+	 * Fall back to the non-DT function to register a bus.
+	 * This way, we don't have to keep compat bits around in drivers.
+	 */
+
+	return mdiobus_register(mdio);
 }
 
 static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
-- 
1.9.0

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

* Re: [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF
  2014-05-06 16:52 [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF Daniel Mack
@ 2014-05-06 17:06 ` Florian Fainelli
  2014-05-07  6:52 ` Mugunthan V N
  2014-05-07 21:16 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2014-05-06 17:06 UTC (permalink / raw)
  To: Daniel Mack; +Cc: mugunthanvnm, David Miller, netdev

2014-05-06 9:52 GMT-07:00 Daniel Mack <zonque@gmail.com>:
> If CONFIG_OF is not set, make of_mdiobus_register() call
> mdiobus_register() instead of returning -ENOSYS.
>
> This way, we can just call of_mdiobus_register() from all DT-enabled
> drivers to handle the compat cases.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  include/linux/of_mdio.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
> index 6fe8464..881a7c3 100644
> --- a/include/linux/of_mdio.h
> +++ b/include/linux/of_mdio.h
> @@ -31,7 +31,12 @@ extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
>  #else /* CONFIG_OF */
>  static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>  {
> -       return -ENOSYS;
> +       /*
> +        * Fall back to the non-DT function to register a bus.
> +        * This way, we don't have to keep compat bits around in drivers.
> +        */
> +
> +       return mdiobus_register(mdio);
>  }
>
>  static inline struct phy_device *of_phy_find_device(struct device_node *phy_np)
> --
> 1.9.0
>



-- 
Florian

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

* Re: [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF
  2014-05-06 16:52 [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF Daniel Mack
  2014-05-06 17:06 ` Florian Fainelli
@ 2014-05-07  6:52 ` Mugunthan V N
  2014-05-07 21:16 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Mugunthan V N @ 2014-05-07  6:52 UTC (permalink / raw)
  To: Daniel Mack, f.fainelli; +Cc: davem, netdev

On Tuesday 06 May 2014 10:22 PM, Daniel Mack wrote:
> If CONFIG_OF is not set, make of_mdiobus_register() call
> mdiobus_register() instead of returning -ENOSYS.
>
> This way, we can just call of_mdiobus_register() from all DT-enabled
> drivers to handle the compat cases.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>

Regards
Mugunthan V N

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

* Re: [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF
  2014-05-06 16:52 [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF Daniel Mack
  2014-05-06 17:06 ` Florian Fainelli
  2014-05-07  6:52 ` Mugunthan V N
@ 2014-05-07 21:16 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-05-07 21:16 UTC (permalink / raw)
  To: zonque; +Cc: f.fainelli, mugunthanvnm, netdev

From: Daniel Mack <zonque@gmail.com>
Date: Tue,  6 May 2014 18:52:16 +0200

> If CONFIG_OF is not set, make of_mdiobus_register() call
> mdiobus_register() instead of returning -ENOSYS.
> 
> This way, we can just call of_mdiobus_register() from all DT-enabled
> drivers to handle the compat cases.
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks Daniel.

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 16:52 [PATCH] net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF Daniel Mack
2014-05-06 17:06 ` Florian Fainelli
2014-05-07  6:52 ` Mugunthan V N
2014-05-07 21:16 ` 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).