Commit 9350ea63 authored by Maxime Chevallier's avatar Maxime Chevallier Committed by Jakub Kicinski
Browse files

net: altera-tse: Don't use netdev name for the PCS mdio bus



The PCS mdio bus must be created before registering the net_device. To
do that, we musn't depend on the netdev name to create the mdio bus
name. Let's use the device's name instead.

Note that this changes the bus name in /sys/bus/mdiobus

Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20251103104928.58461-4-maxime.chevallier@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dd2619d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1404,7 +1404,7 @@ static int altera_tse_probe(struct platform_device *pdev)
			 (unsigned long) control_port->start, priv->rx_irq,
			 priv->tx_irq);

	snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", ndev->name);
	snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", dev_name(&pdev->dev));
	pcs_bus = devm_mdio_regmap_register(&pdev->dev, &mrc);
	if (IS_ERR(pcs_bus)) {
		ret = PTR_ERR(pcs_bus);