From: Benjamin Herrenschmidt Date: Mon, 24 Jul 2017 06:59:07 +0000 (+1000) Subject: ftgmac100: Make the MDIO bus a child of the ethernet device X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d57b9db1ae0cde366c9cc6b038cb1e8ff05557a1;p=openwrt%2Fstaging%2Fblogic.git ftgmac100: Make the MDIO bus a child of the ethernet device Populate mii_bus->parent with our own platform device before registering, which makes it easier to locate the MDIO bus in sysfs when trying to diagnose problems. Signed-off-by: Benjamin Herrenschmidt Acked-by: Joel Stanley Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index bfda0b2e2b82..cdb979440ca5 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1682,6 +1682,7 @@ static int ftgmac100_setup_mdio(struct net_device *netdev) priv->mii_bus->name = "ftgmac100_mdio"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%d", pdev->name, pdev->id); + priv->mii_bus->parent = priv->dev; priv->mii_bus->priv = priv->netdev; priv->mii_bus->read = ftgmac100_mdiobus_read; priv->mii_bus->write = ftgmac100_mdiobus_write;