Skip to content

Commit

Permalink
net: phylink: convert phylink_mii_c22_pcs_config() to neg_mode
Browse files Browse the repository at this point in the history
Use phylink_pcs_neg_mode() for phylink_mii_c22_pcs_config(). This
results in no functional change.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1qA8Dj-00EaFG-Mt@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Russell King (Oracle) authored and Jakub Kicinski committed Jun 23, 2023
1 parent f99d471 commit cdb08aa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/net/phy/phylink.c
Original file line number Diff line number Diff line change
Expand Up @@ -3558,6 +3558,7 @@ int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,
phy_interface_t interface,
const unsigned long *advertising)
{
unsigned int neg_mode;
bool changed = 0;
u16 bmcr;
int ret, adv;
Expand All @@ -3571,15 +3572,13 @@ int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,
changed = ret;
}

/* Ensure ISOLATE bit is disabled */
if (mode == MLO_AN_INBAND &&
(interface == PHY_INTERFACE_MODE_SGMII ||
interface == PHY_INTERFACE_MODE_QSGMII ||
linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, advertising)))
neg_mode = phylink_pcs_neg_mode(mode, interface, advertising);
if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED)
bmcr = BMCR_ANENABLE;
else
bmcr = 0;

/* Configure the inband state. Ensure ISOLATE bit is disabled */
ret = mdiodev_modify(pcs, MII_BMCR, BMCR_ANENABLE | BMCR_ISOLATE, bmcr);
if (ret < 0)
return ret;
Expand Down

0 comments on commit cdb08aa

Please sign in to comment.