Commit 569aad4f authored by Oleksij Rempel's avatar Oleksij Rempel Committed by David S. Miller

net: ag71xx: fix mdio subnode support

This patch is syncing driver with actual devicetree documentation:
Documentation/devicetree/bindings/net/qca,ar71xx.txt
|Optional subnodes:
|- mdio : specifies the mdio bus, used as a container for phy nodes
|  according to phy.txt in the same directory

The driver was working with fixed phy without any noticeable issues. This bug
was uncovered by introducing dsa ar9331-switch driver.
Since no one reported this bug until now, I assume no body is using it
and this patch should not brake existing system.

Fixes: d51b6ce4 ("net: ethernet: add ag71xx driver")
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b33210e3
...@@ -526,7 +526,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) ...@@ -526,7 +526,7 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
struct device *dev = &ag->pdev->dev; struct device *dev = &ag->pdev->dev;
struct net_device *ndev = ag->ndev; struct net_device *ndev = ag->ndev;
static struct mii_bus *mii_bus; static struct mii_bus *mii_bus;
struct device_node *np; struct device_node *np, *mnp;
int err; int err;
np = dev->of_node; np = dev->of_node;
...@@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag) ...@@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
msleep(200); msleep(200);
} }
err = of_mdiobus_register(mii_bus, np); mnp = of_get_child_by_name(np, "mdio");
err = of_mdiobus_register(mii_bus, mnp);
of_node_put(mnp);
if (err) if (err)
goto mdio_err_put_clk; goto mdio_err_put_clk;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment