]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: Fix mdio child node detection
authorGuenter Roeck <linux@roeck-us.net>
Tue, 26 Oct 2021 17:39:50 +0000 (10:39 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Oct 2021 00:12:18 +0000 (17:12 -0700)
commit3409089444f25810ae4ff438f389d454c67241d3
tree8bb8b2f22cdcf995458ce9ca90ed555b3d10f673
parentf0ed04c2722c4529931e1902eb6980cab5b85bd2
net: macb: Fix mdio child node detection

Commit 377f5178ff6f ("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: 377f5178ff6f ("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>
drivers/net/ethernet/cadence/macb_main.c