Commit ca785888 authored by Jesse Van Gavere's avatar Jesse Van Gavere Committed by Jakub Kicinski
Browse files

net: dsa: microchip: Make MDIO bus name unique



In configurations with 2 or more DSA clusters it will fail to allocate
unique MDIO bus names as only the switch ID is used, fix this by using
a combination of the tree ID and switch ID when needed

Signed-off-by: default avatarJesse Van Gavere <jesse.vangavere@scioteq.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241206204202.649912-1-jesse.vangavere@scioteq.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2d20773a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2550,8 +2550,12 @@ static int ksz_mdio_register(struct ksz_device *dev)
		bus->read = ksz_sw_mdio_read;
		bus->write = ksz_sw_mdio_write;
		bus->name = "ksz user smi";
		if (ds->dst->index != 0) {
			snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d-%d", ds->dst->index, ds->index);
		} else {
			snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index);
		}
	}

	ret = ksz_parse_dt_phy_config(dev, bus, mdio_np);
	if (ret)