Commit 399ba77a authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: Simplify dsa_slave_phy_setup()

Remove the code that tried to identify if a PHY designated by Device
Tree required diversion through the DSA-created MDIO bus. This was
created mainly for the bcm_sf2.c driver back when it did not have its
own MDIO bus driver, which it now has since 461cd1b0 ("net: dsa:
bcm_sf2: Register our slave MDIO bus").
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Tested-by: default avatarMartin Hundebøll <mnhu@prevas.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 010b64f7
...@@ -1060,28 +1060,10 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) ...@@ -1060,28 +1060,10 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev)
phy_flags = ds->ops->get_phy_flags(ds, dp->index); phy_flags = ds->ops->get_phy_flags(ds, dp->index);
if (phy_dn) { if (phy_dn) {
int phy_id = of_mdio_parse_addr(&slave_dev->dev, phy_dn); slave_dev->phydev = of_phy_connect(slave_dev, phy_dn,
dsa_slave_adjust_link,
/* If this PHY address is part of phys_mii_mask, which means phy_flags,
* that we need to divert reads and writes to/from it, then we p->phy_interface);
* want to bind this device using the slave MII bus created by
* DSA to make that happen.
*/
if (!phy_is_fixed && phy_id >= 0 &&
(ds->phys_mii_mask & (1 << phy_id))) {
ret = dsa_slave_phy_connect(slave_dev, phy_id);
if (ret) {
netdev_err(slave_dev, "failed to connect to phy%d: %d\n", phy_id, ret);
of_node_put(phy_dn);
return ret;
}
} else {
slave_dev->phydev = of_phy_connect(slave_dev, phy_dn,
dsa_slave_adjust_link,
phy_flags,
p->phy_interface);
}
of_node_put(phy_dn); of_node_put(phy_dn);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment