diff mbox series

[RFC,net-next,6/9] net: mvpp2: switch PCS driver to use phylink_pcs_neg_mode()

Message ID E1q1UMJ-007FT7-HH@rmk-PC.armlinux.org.uk (mailing list archive)
State New, archived
Headers show
Series Add and use helper for PCS negotiation modes | expand

Commit Message

Russell King (Oracle) May 23, 2023, 3:55 p.m. UTC
Use the newly introduced phylink_pcs_neg_mode() to configure whether
inband-AN should be used.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index adc953611913..9ec806d6cd20 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -6239,6 +6239,7 @@  static int mvpp2_gmac_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
 {
 	struct mvpp2_port *port = mvpp2_pcs_gmac_to_port(pcs);
 	u32 mask, val, an, old_an, changed;
+	unsigned int neg_mode;
 
 	mask = MVPP2_GMAC_IN_BAND_AUTONEG_BYPASS |
 	       MVPP2_GMAC_IN_BAND_AUTONEG |
@@ -6246,7 +6247,8 @@  static int mvpp2_gmac_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
 	       MVPP2_GMAC_FLOW_CTRL_AUTONEG |
 	       MVPP2_GMAC_AN_DUPLEX_EN;
 
-	if (phylink_autoneg_inband(mode)) {
+	neg_mode = phylink_pcs_neg_mode(mode, interface, advertising);
+	if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) {
 		mask |= MVPP2_GMAC_CONFIG_MII_SPEED |
 			MVPP2_GMAC_CONFIG_GMII_SPEED |
 			MVPP2_GMAC_CONFIG_FULL_DUPLEX;