net: phy: mscc: use mdiobus_get_phy()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- drivers/net/phy/mscc/mscc_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/phy/mscc/mscc_main.c +3 -4
@@ -1292,7 +1292,7 @@ static int vsc8584_config_pre_init(struct phy_device *phydev)*/ 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 ;
Signature · 1 line
2.20.1
Quoted 4 lines · Michael Walle
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 <[email protected]>
Thanks Michael
Reviewed-by Andrew Lunn <[email protected]>
Andrew
From: Michael Walle <[email protected]>
Date: Sun, 19 Apr 2020 10:27:57 +0200
Quoted 4 lines
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 <[email protected]>
Applied, thanks.