summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-29 12:25:01 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-30 11:16:03 +0100
commit7f9b2e5da5571be0c725f99aef4875e4c827c162 (patch)
treea85556f43c8b455adf495f3c75b65c418a9e03b0 /drivers
parent5ec73885cafb02ba31391160d880e2b661f9d39c (diff)
net: phylink: rearrange phylink_parse_mode()
Of the two users of phylink_config->ovr_an_inband, both manually check for a fixed link before setting this flag (or clearing it if they find a fixed link.) This is unnecessary complication. This is the first stage of fixing this. Rearrange phylink_parse_mode() a little so we can change how phylink_config->ovr_an_inband works. This will allow the flag to be tested before checking for the fixed link properties in the next patch. Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phylink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index f39a8dd25870..a0453bffb4ae 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -899,12 +899,15 @@ static int phylink_parse_mode(struct phylink *pl,
return -EINVAL;
}
+ pl->cfg_link_an_mode = MLO_AN_INBAND;
+ }
+
+ if (pl->cfg_link_an_mode == MLO_AN_INBAND) {
linkmode_zero(pl->supported);
phylink_set(pl->supported, MII);
phylink_set(pl->supported, Autoneg);
phylink_set(pl->supported, Asym_Pause);
phylink_set(pl->supported, Pause);
- pl->cfg_link_an_mode = MLO_AN_INBAND;
switch (pl->link_config.interface) {
case PHY_INTERFACE_MODE_SGMII: