diff options
author | Michael Walle <michael@walle.cc> | 2020-04-19 10:27:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-20 12:07:22 -0700 |
commit | cceadc831e728fde74c21813519962c648f5ca7c (patch) | |
tree | cda973a330569df57bdf9acde3af82cb9ac9fe58 /drivers/net/phy/mscc/mscc_main.c | |
parent | 6bedc6948bcfd43b22b29d3f0621300e8a3219e6 (diff) |
net: phy: mscc: use mdiobus_get_phy()
Don't use internal knowledge of the mdio bus core, instead use
mdiobus_get_phy() which does the same thing.
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mscc/mscc_main.c')
-rw-r--r-- | drivers/net/phy/mscc/mscc_main.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c index acddef79f4e8..5391acdece05 100644 --- a/drivers/net/phy/mscc/mscc_main.c +++ b/drivers/net/phy/mscc/mscc_main.c @@ -1292,7 +1292,7 @@ out: */ static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed) { - struct mdio_device **map = phydev->mdio.bus->mdio_map; + struct mii_bus *bus = phydev->mdio.bus; struct vsc8531_private *vsc8531; struct phy_device *phy; int i, addr; @@ -1306,11 +1306,10 @@ static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed) else addr = vsc8531->base_addr + i; - if (!map[addr]) + phy = mdiobus_get_phy(bus, addr); + if (!phy) continue; - phy = container_of(map[addr], struct phy_device, mdio); - if ((phy->phy_id & phydev->drv->phy_id_mask) != (phydev->drv->phy_id & phydev->drv->phy_id_mask)) continue; |