aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 6b71b0034060..b0e9f9c51721 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -254,12 +254,12 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd)
254 if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0) 254 if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0)
255 return -EINVAL; 255 return -EINVAL;
256 256
257 if (cmd->autoneg == AUTONEG_DISABLE 257 if (cmd->autoneg == AUTONEG_DISABLE &&
258 && ((cmd->speed != SPEED_1000 258 ((cmd->speed != SPEED_1000 &&
259 && cmd->speed != SPEED_100 259 cmd->speed != SPEED_100 &&
260 && cmd->speed != SPEED_10) 260 cmd->speed != SPEED_10) ||
261 || (cmd->duplex != DUPLEX_HALF 261 (cmd->duplex != DUPLEX_HALF &&
262 && cmd->duplex != DUPLEX_FULL))) 262 cmd->duplex != DUPLEX_FULL)))
263 return -EINVAL; 263 return -EINVAL;
264 264
265 phydev->autoneg = cmd->autoneg; 265 phydev->autoneg = cmd->autoneg;
@@ -353,9 +353,9 @@ int phy_mii_ioctl(struct phy_device *phydev,
353 353
354 phy_write(phydev, mii_data->reg_num, val); 354 phy_write(phydev, mii_data->reg_num, val);
355 355
356 if (mii_data->reg_num == MII_BMCR 356 if (mii_data->reg_num == MII_BMCR &&
357 && val & BMCR_RESET 357 val & BMCR_RESET &&
358 && phydev->drv->config_init) { 358 phydev->drv->config_init) {
359 phy_scan_fixups(phydev); 359 phy_scan_fixups(phydev);
360 phydev->drv->config_init(phydev); 360 phydev->drv->config_init(phydev);
361 } 361 }