net: phy: reset only targeted phy

It is possible to address another chip on same MDIO bus. The case is
correctly handled for media advertising. It is taken into account
only if mii_data->phy_id == phydev->addr. However, this condition
was missing for reset case.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jérôme Pouiller 2015-12-03 10:02:35 +01:00 committed by David S. Miller
parent c5ba5c8ac8
commit cf18b7788f
1 changed files with 2 additions and 1 deletions

View File

@ -448,7 +448,8 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
mdiobus_write(phydev->bus, mii_data->phy_id, mdiobus_write(phydev->bus, mii_data->phy_id,
mii_data->reg_num, val); mii_data->reg_num, val);
if (mii_data->reg_num == MII_BMCR && if (mii_data->phy_id == phydev->addr &&
mii_data->reg_num == MII_BMCR &&
val & BMCR_RESET) val & BMCR_RESET)
return phy_init_hw(phydev); return phy_init_hw(phydev);