Skip to content

Commit 1c17f9d

Browse files
Russell King (Oracle)Paolo Abeni
authored andcommitted
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: Russell King (Oracle) <[email protected]> Tested-by: Serge Semin <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent b61a465 commit 1c17f9d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/pcs/pcs-xpcs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,7 @@ static void xpcs_link_up_1000basex(struct dw_xpcs *xpcs, unsigned int neg_mode,
11371137
dev_err(&xpcs->mdiodev->dev, "%s: half duplex not supported\n",
11381138
__func__);
11391139

1140-
val = BMCR_SPEED1000;
1141-
if (duplex == DUPLEX_FULL)
1142-
val |= BMCR_FULLDPLX;
1143-
1140+
val = mii_bmcr_encode_fixed(speed, duplex);
11441141
ret = xpcs_write(xpcs, MDIO_MMD_VEND2, MII_BMCR, val);
11451142
if (ret)
11461143
dev_err(&xpcs->mdiodev->dev, "%s: xpcs_write returned %pe\n",

0 commit comments

Comments
 (0)