Skip to content

Commit

Permalink
net: phy: fix wrong mask to phy_modify()
Browse files Browse the repository at this point in the history
When forcing a specific link mode, the PHY driver must clear the
existing speed and duplex bits in BMCR while preserving some other
control bits. This logic was accidentally inverted with the introduction
of phy_modify().

Fixes: fea23fb ("net: phy: convert read-modify-write to phy_modify()")
Signed-off-by: Ingo van Lil <inguin@gmx.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ingo van Lil authored and David S. Miller committed Feb 12, 2018
1 parent 808cf9e commit 18a5b05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ int genphy_setup_forced(struct phy_device *phydev)
ctl |= BMCR_FULLDPLX;

return phy_modify(phydev, MII_BMCR,
BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN, ctl);
~(BMCR_LOOPBACK | BMCR_ISOLATE | BMCR_PDOWN), ctl);
}
EXPORT_SYMBOL(genphy_setup_forced);

Expand Down

0 comments on commit 18a5b05

Please sign in to comment.