aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/cadence/macb_main.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-10-26 10:39:50 -0700
committerJakub Kicinski <kuba@kernel.org>2021-10-27 17:12:18 -0700
commit8db3cbc50748fe0990bfaa7dea113406b416e70b (patch)
tree8bb8b2f22cdcf995458ce9ca90ed555b3d10f673 /drivers/net/ethernet/cadence/macb_main.c
parentnet: sch: simplify condtion for selecting mini_Qdisc_pair buffer (diff)
downloadlinux-dev-8db3cbc50748fe0990bfaa7dea113406b416e70b.tar.xz
linux-dev-8db3cbc50748fe0990bfaa7dea113406b416e70b.zip
net: macb: Fix mdio child node detection
Commit 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it exists") added code to detect if a 'mdio' child node exists to the macb driver. Ths added code does, however, not actually check if the child node exists, but if the parent node exists. This results in errors such as macb 10090000.ethernet eth0: Could not attach PHY (-19) if there is no 'mdio' child node. Fix the code to actually check for the child node. Fixes: 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it exists") Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Sean Anderson <sean.anderson@seco.com> Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20211026173950.353636-1-linux@roeck-us.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/cadence/macb_main.c')
-rw-r--r--drivers/net/ethernet/cadence/macb_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 309371abfe23..ffce528aa00e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -901,7 +901,7 @@ static int macb_mdiobus_register(struct macb *bp)
* directly under the MAC node
*/
child = of_get_child_by_name(np, "mdio");
- if (np) {
+ if (child) {
int ret = of_mdiobus_register(bp->mii_bus, child);
of_node_put(child);