Skip to content

Commit

Permalink
net: phy: mscc: use mdiobus_get_phy()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Walle authored and David S. Miller committed Apr 20, 2020
1 parent 6bedc69 commit cceadc8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/phy/mscc/mscc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit cceadc8

Please sign in to comment.