Skip to contentSkip to conversation

net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF

PATCH Applied Daniel Mack 4 participants 4 messages May 6, 2014 – May 7, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mdio: of_mdiobus_register(): fall back to mdiobus_register() for !CONFIG_OF

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.

---
 include/linux/of_mdio.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/linux/of_mdio.h +6 -1
index 6fe8464..881a7c3 100644
@@ -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)
Signature · 1 line
1.9.0
Acked-by on v1 1/1
#1 lore raw

2014-05-06 9:52 GMT-07:00 Daniel Mack <[email protected]>:

Quoted 8 lines

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.

Quoted 25 lines
---
 include/linux/of_mdio.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/linux/of_mdio.h +6 -2
index 6fe8464..881a7c3 100644
@@ -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

Signature · 1 line
Florian
maintainer Applied
#3 lore raw
In reply to Daniel Mack

From: Daniel Mack <[email protected]>
Date: Tue, 6 May 2014 18:52:16 +0200

Quoted 8 lines

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.

Applied, thanks Daniel.