diff options
author | Daniel Mack <zonque@gmail.com> | 2014-05-24 03:34:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-29 18:23:29 -0400 |
commit | 86f6cf41272de9d6ffa05ab46028b15d160a6f3e (patch) | |
tree | 9dbea82327ba7dbd59d840da6ac29e2a13b92097 /drivers/net/phy | |
parent | 8f8382888cbaf6de13046437d41a1c3d1394d51f (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 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index a6284964b711..2e58aa54484c 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -300,6 +300,12 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) | |||
300 | if (IS_ERR(phydev) || phydev == NULL) | 300 | if (IS_ERR(phydev) || phydev == NULL) |
301 | return phydev; | 301 | return phydev; |
302 | 302 | ||
303 | /* | ||
304 | * For DT, see if the auto-probed phy has a correspoding child | ||
305 | * in the bus node, and set the of_node pointer in this case. | ||
306 | */ | ||
307 | of_mdiobus_link_phydev(bus, phydev); | ||
308 | |||
303 | err = phy_device_register(phydev); | 309 | err = phy_device_register(phydev); |
304 | if (err) { | 310 | if (err) { |
305 | phy_device_free(phydev); | 311 | phy_device_free(phydev); |