aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-05-24 03:34:26 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-29 18:23:29 -0400
commit86f6cf41272de9d6ffa05ab46028b15d160a6f3e (patch)
tree9dbea82327ba7dbd59d840da6ac29e2a13b92097 /include
parent8f8382888cbaf6de13046437d41a1c3d1394d51f (diff)
net: of_mdio: add of_mdiobus_link_phydev()
Add a function to walk the list of subnodes of a mdio bus and look for a node that matches the phy's address with its 'reg' property. If found, set the of_node pointer for the phy. This allows auto-probed pyh devices to be augmented by information passed in via DT. Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/of_mdio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index d449018d0726..a70c9493d55a 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -25,6 +25,9 @@ struct phy_device *of_phy_attach(struct net_device *dev,
25 25
26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 26extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
27 27
28extern void of_mdiobus_link_phydev(struct mii_bus *mdio,
29 struct phy_device *phydev);
30
28#else /* CONFIG_OF */ 31#else /* CONFIG_OF */
29static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) 32static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
30{ 33{
@@ -60,6 +63,11 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
60{ 63{
61 return NULL; 64 return NULL;
62} 65}
66
67static inline void of_mdiobus_link_phydev(struct mii_bus *mdio,
68 struct phy_device *phydev)
69{
70}
63#endif /* CONFIG_OF */ 71#endif /* CONFIG_OF */
64 72
65#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) 73#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY)