From: Liam Beguin <lbeg...@tycoint.com>

mv88e6xxx_mdio_register automatically generates mdio buses for each switch
discovered in the devicetree. When switch nodes are embedded in other nodes,
this can cause sysfs naming collisions since full_name may be truncated.

Only use devicetree node name instead of the full devicetree path
as the mdio bus name.

Signed-off-by: Liam Beguin <lbeg...@tycoint.com>
Signed-off-by: Alexandre Messier <amess...@tycoint.com>
Signed-off-by: Sylvain Lemieux <slemi...@tycoint.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 3354f99df378..80b4387d573e 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2688,8 +2688,8 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip 
*chip,
        mdio_bus->external = external;
 
        if (np) {
-               bus->name = np->full_name;
-               snprintf(bus->id, MII_BUS_ID_SIZE, "%s", np->full_name);
+               bus->name = np->name;
+               snprintf(bus->id, MII_BUS_ID_SIZE, "%s", np->name);
        } else {
                bus->name = "mv88e6xxx SMI";
                snprintf(bus->id, MII_BUS_ID_SIZE, "mv88e6xxx-%d", index++);
-- 
2.11.0

Reply via email to