From: Russell King (Oracle) Date: Wed, 29 May 2024 13:29:19 +0000 (+0100) Subject: net: phylink: rearrange phylink_parse_mode() X-Git-Tag: v6.11-rc1~163^2~280^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75518b0dc9d602bdd0e0ee4e04806dff53cb761a;p=thirdparty%2Fkernel%2Flinux.git 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. 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. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/E1sCJMl-00Ecqp-K0@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 994471fad833f..5abd127135986 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: