diff mbox series

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

Message ID E1q1UME-007FT0-Dw@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/mvneta.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index e2abc00d0472..d669276639b1 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4009,6 +4009,7 @@  static int mvneta_pcs_config(struct phylink_pcs *pcs,
 {
 	struct mvneta_port *pp = mvneta_pcs_to_port(pcs);
 	u32 mask, val, an, old_an, changed;
+	unsigned int neg_mode;
 
 	mask = MVNETA_GMAC_INBAND_AN_ENABLE |
 	       MVNETA_GMAC_INBAND_RESTART_AN |
@@ -4016,7 +4017,9 @@  static int mvneta_pcs_config(struct phylink_pcs *pcs,
 	       MVNETA_GMAC_AN_FLOW_CTRL_EN |
 	       MVNETA_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 |= MVNETA_GMAC_CONFIG_MII_SPEED |
 			MVNETA_GMAC_CONFIG_GMII_SPEED |
 			MVNETA_GMAC_CONFIG_FULL_DUPLEX;