提交 8db3cbc5 编写于 作者: G Guenter Roeck 提交者: Jakub Kicinski

net: macb: Fix mdio child node detection

Commit 4d98bb0d ("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: 4d98bb0d ("net: macb: Use mdio child node for MDIO bus if it exists")
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Reviewed-by: NSean Anderson <sean.anderson@seco.com>
Tested-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20211026173950.353636-1-linux@roeck-us.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 85c0c3eb
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册