Commit e62dbaff authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller

net: phy: marvell: use mii_bmcr_encode_fixed()

Make use of the newly introduced mii_bmcr_encode_fixed() to get the
BMCR value when setting loopback mode for the 88e1510.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f28a602b
......@@ -1991,15 +1991,9 @@ static int m88e1510_loopback(struct phy_device *phydev, bool enable)
int err;
if (enable) {
u16 bmcr_ctl = 0, mscr2_ctl = 0;
u16 bmcr_ctl, mscr2_ctl = 0;
if (phydev->speed == SPEED_1000)
bmcr_ctl = BMCR_SPEED1000;
else if (phydev->speed == SPEED_100)
bmcr_ctl = BMCR_SPEED100;
if (phydev->duplex == DUPLEX_FULL)
bmcr_ctl |= BMCR_FULLDPLX;
bmcr_ctl = mii_bmcr_encode_fixed(phydev->speed, phydev->duplex);
err = phy_write(phydev, MII_BMCR, bmcr_ctl);
if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment