diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-21 16:03:22 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-13 12:00:28 +0100 |
commit | ac855ffe5730f7c95644e6b19ac340bf0f53cb16 (patch) | |
tree | 865fd5e0d51f7b635cf5a4f529f4bf7add14f6ba /drivers/net/phy/phy.c | |
parent | 3639b69111fffd8d612e8314c228b7cb82b52f61 (diff) | |
download | barebox-ac855ffe5730f7c95644e6b19ac340bf0f53cb16.tar.gz barebox-ac855ffe5730f7c95644e6b19ac340bf0f53cb16.tar.xz |
net: phy: fix miibus parent device of_node not matching phy node
The device node of a miibus parent device usually points to the ethernet
device node whereas the parent device node of a phy device usually
points to the mdio {} subnode between the ethernet node and the phy
node, so both can't match. Ethernet drivers usually provide a pointer
to the mdio {} subnode in miibus::dev.of_node, so use that to match
against the phy nodes parent.
This occured on a TQMa6UL where two FECs are registered, but both phys
are connected to the FEC2.
Link: https://lore.barebox.org/20240221150323.2715164-8-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ad02732ff9..abd78b2c80 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -358,7 +358,7 @@ static struct phy_device *of_mdio_find_phy(struct eth_device *edev) if (!of_property_read_u32(phy_node, "reg", &addr)) { of_device_ensure_probed(phy_node->parent); for_each_mii_bus(bus) { - if (bus->parent->of_node == phy_node->parent) { + if (bus->dev.of_node == phy_node->parent) { struct phy_device *phy = mdiobus_scan(bus, addr); if (!IS_ERR(phy)) return phy; |