summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phylink.c
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-04-26 09:58:56 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-07 10:49:39 +0100
commitb1e7652a5d6811313805e2af8d61410c1ac5101a (patch)
treecf0d0bc8980dc9662ab0488602cd6a838bf1423d /drivers/net/phy/phylink.c
parent64d96f24dfad6ddaa3d4e803f6c05aac2beba8e9 (diff)
net: phylink: move phylink_pcs_neg_mode() in phylink_major_config()
Move the call to phylink_pcs_neg_mode() in phylink_major_config() after we have selected the appropriate PCS to later allow the capabilities of the PCS to be used when deciding which pcs_neg_mode should be used. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r--drivers/net/phy/phylink.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index fd57dc3f1bcb..570ca5a5a42b 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1184,10 +1184,6 @@ static void phylink_major_config(struct phylink *pl, bool restart,
phylink_an_mode_str(pl->req_link_an_mode),
phy_modes(state->interface));
- pl->pcs_neg_mode = phylink_pcs_neg_mode(pl->req_link_an_mode,
- state->interface,
- state->advertising);
-
if (pl->using_mac_select_pcs) {
pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
if (IS_ERR(pcs)) {
@@ -1200,6 +1196,10 @@ static void phylink_major_config(struct phylink *pl, bool restart,
pcs_changed = pcs && pl->pcs != pcs;
}
+ pl->pcs_neg_mode = phylink_pcs_neg_mode(pl->req_link_an_mode,
+ state->interface,
+ state->advertising);
+
/* set the active link AN mode, which may end up different from the
* current link AN mode depending on the PCS and PHY capabilities.
*/