net: of_mdio: add of_mdiobus_link_phydev()
[sfrench/cifs-2.6.git] / drivers / net / phy / mdio_bus.c
index a6284964b71144055511dd7ecdc91b09ae09b02a..2e58aa54484c9ca4e3154e231a3af2766bc84933 100644 (file)
@@ -300,6 +300,12 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
        if (IS_ERR(phydev) || phydev == NULL)
                return phydev;
 
+       /*
+        * For DT, see if the auto-probed phy has a correspoding child
+        * in the bus node, and set the of_node pointer in this case.
+        */
+       of_mdiobus_link_phydev(bus, phydev);
+
        err = phy_device_register(phydev);
        if (err) {
                phy_device_free(phydev);