Commit "8b63ec1837fa phylib: Make PHYs children of their MDIO bus, not the bus' parent." broke finding PHY properties in the MAC device tree node. The parent device is now the MDIO bus, not the MAC. Use attached_dev towards the MAC device tree node.
Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.") Signed-off-by: Andrew Lunn <and...@lunn.ch> --- Compile tested only. Dinh, please could you test it and report back if it works or not. drivers/net/phy/micrel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 499185eaf413..9e2083a1a5a9 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -25,6 +25,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/phy.h> +#include <linux/netdevice.h> #include <linux/micrel_phy.h> #include <linux/of.h> #include <linux/clk.h> @@ -340,8 +341,9 @@ static int ksz9021_config_init(struct phy_device *phydev) const struct device *dev = &phydev->dev; const struct device_node *of_node = dev->of_node; - if (!of_node && dev->parent->of_node) - of_node = dev->parent->of_node; + if (!of_node && phydev->attached_dev && + phydev->attached_dev->dev.of_node) + of_node = phydev->attached_dev->dev.of_node; if (of_node) { ksz9021_load_values_from_of(phydev, of_node, -- 2.5.1 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html