]> Pileus Git - ~andy/linux/commitdiff
octeon: fix PHY name to match MDIO bus name
authorFlorian Fainelli <florian@openwrt.org>
Mon, 13 Feb 2012 01:23:23 +0000 (01:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Feb 2012 21:04:09 +0000 (16:04 -0500)
Commit "d6c25be: mdio-octeon: use an unique MDIO bus name" changed the
octeon MDIO bus name from "0" to "mdio-octeon-0", change the PHY
formatting logic to account for that name change, so that PHY connection
on this bus succeeds.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/octeon/octeon_mgmt.c

index 212f43b308a3c27ed411b21768e160e0d899a571..cd827ff4a021f74284574f75cc27de97b4c3e7fe 100644 (file)
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev)
 static int octeon_mgmt_init_phy(struct net_device *netdev)
 {
        struct octeon_mgmt *p = netdev_priv(netdev);
-       char phy_id[20];
+       char phy_id[MII_BUS_ID_SIZE + 3];
 
        if (octeon_is_simulation()) {
                /* No PHYs in the simulator. */
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
                return 0;
        }
 
-       snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port);
+       snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);
 
        p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
                                PHY_INTERFACE_MODE_MII);