diff mbox series

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

Message ID E1q1UMT-007FTJ-Ov@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/microchip/lan966x/lan966x_phylink.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c b/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
index c5f9803e6e63..29bbd642cec8 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
@@ -103,12 +103,16 @@  static int lan966x_pcs_config(struct phylink_pcs *pcs,
 {
 	struct lan966x_port *port = lan966x_pcs_to_port(pcs);
 	struct lan966x_port_config config;
+	unsigned int neg_mode;
 	int ret;
 
+	neg_mode = phylink_pcs_neg_mode(mode, interface, advertising);
+
 	config = port->config;
 	config.portmode = interface;
-	config.inband = phylink_autoneg_inband(mode);
-	config.autoneg = phylink_test(advertising, Autoneg);
+	config.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_DISABLED ||
+			neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
+	config.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
 	config.advertising = advertising;
 
 	ret = lan966x_port_pcs_set(port, &config);