Skip to contentSkip to conversation

ftgmac100: Make the MDIO bus a child of the ethernet device

PATCH Applied Benjamin Herrenschmidt 3 participants 3 messages Jul 24, 2017 – Jul 25, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 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.

---
 drivers/net/ethernet/faraday/ftgmac100.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/faraday/ftgmac100.c +1 -0
index 2b17f7023d91..fce0aa4f78b7 100644
@@ -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;
Acked-by on v1 2/2
#1 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

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.

Quoted 17 lines
---
 drivers/net/ethernet/faraday/ftgmac100.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/faraday/ftgmac100.c +1 -0
index 2b17f7023d91..fce0aa4f78b7 100644
@@ -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;