]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: altera-tse: Don't use netdev name for the PCS mdio bus
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Mon, 3 Nov 2025 10:49:26 +0000 (11:49 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Nov 2025 02:15:15 +0000 (18:15 -0800)
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: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20251103104928.58461-4-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/altera/altera_tse_main.c

index 343c78a493a1bd549db247d996a7b1d04dd7ae04..003df8970998481e41fc223bdfde0d3b16c1d6f4 100644 (file)
@@ -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);