提交 cceadc83 编写于 作者: M Michael Walle 提交者: David S. Miller

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: NMichael Walle <michael@walle.cc>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6bedc694
...@@ -1292,7 +1292,7 @@ static int vsc8584_config_pre_init(struct phy_device *phydev) ...@@ -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) 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 vsc8531_private *vsc8531;
struct phy_device *phy; struct phy_device *phy;
int i, addr; int i, addr;
...@@ -1306,11 +1306,10 @@ static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed) ...@@ -1306,11 +1306,10 @@ static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed)
else else
addr = vsc8531->base_addr + i; addr = vsc8531->base_addr + i;
if (!map[addr]) phy = mdiobus_get_phy(bus, addr);
if (!phy)
continue; continue;
phy = container_of(map[addr], struct phy_device, mdio);
if ((phy->phy_id & phydev->drv->phy_id_mask) != if ((phy->phy_id & phydev->drv->phy_id_mask) !=
(phydev->drv->phy_id & phydev->drv->phy_id_mask)) (phydev->drv->phy_id & phydev->drv->phy_id_mask))
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册