Commit 1c17f9d3 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Paolo Abeni
Browse files

net: pcs: xpcs: replace open-coded mii_bmcr_encode_fixed()



We can now see that we have an open-coded version of
mii_bmcr_encode_fixed() when this is called with SPEED_1000:

        val = BMCR_SPEED1000;
        if (duplex == DUPLEX_FULL)
                val |= BMCR_FULLDPLX;

Replace this with a call to mii_bmcr_encode_fixed().

Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent b61a465a
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1137,10 +1137,7 @@ static void xpcs_link_up_1000basex(struct dw_xpcs *xpcs, unsigned int neg_mode,
		dev_err(&xpcs->mdiodev->dev, "%s: half duplex not supported\n",
			__func__);

	val = BMCR_SPEED1000;
	if (duplex == DUPLEX_FULL)
		val |= BMCR_FULLDPLX;

	val = mii_bmcr_encode_fixed(speed, duplex);
	ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MII_BMCR, val);
	if (ret)
		dev_err(&xpcs->mdiodev->dev, "%s: xpcs_write returned %pe\n",