public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux•org.uk>
To: Andrew Lunn <andrew@lunn•ch>, Heiner Kallweit <hkallweit1@gmail•com>
Cc: Andrew Halaney <ahalaney@redhat•com>,
	Serge Semin <fancer.lancer@gmail•com>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	netdev@vger•kernel.org
Subject: [PATCH net-next 2/6] net: phylink: move test for ovr_an_inband
Date: Wed, 29 May 2024 14:29:24 +0100	[thread overview]
Message-ID: <E1sCJMq-00Ecqv-P8@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZlctinnTT8Xhemsm@shell.armlinux.org.uk>

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.

Test ovr_an_inband before checking for the fixed-link properties, which
will allow ovr_an_inband to be overriden by a fixed link specification.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux•org.uk>
---
 drivers/net/phy/phylink.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 5abd12713598..c81f1c1ee675 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -885,14 +885,16 @@ static int phylink_parse_mode(struct phylink *pl,
 	const char *managed;
 	unsigned long caps;
 
+	if (pl->config->ovr_an_inband)
+		pl->cfg_link_an_mode = MLO_AN_INBAND;
+
 	dn = fwnode_get_named_child_node(fwnode, "fixed-link");
 	if (dn || fwnode_property_present(fwnode, "fixed-link"))
 		pl->cfg_link_an_mode = MLO_AN_FIXED;
 	fwnode_handle_put(dn);
 
 	if ((fwnode_property_read_string(fwnode, "managed", &managed) == 0 &&
-	     strcmp(managed, "in-band-status") == 0) ||
-	    pl->config->ovr_an_inband) {
+	     strcmp(managed, "in-band-status") == 0)) {
 		if (pl->cfg_link_an_mode == MLO_AN_FIXED) {
 			phylink_err(pl,
 				    "can't use both fixed-link and in-band-status\n");
-- 
2.30.2


  parent reply	other threads:[~2024-05-29 13:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29 13:28 [PATCH net-next 0/6] net: phylink: rearrange ovr_an_inband support Russell King (Oracle)
2024-05-29 13:29 ` [PATCH net-next 1/6] net: phylink: rearrange phylink_parse_mode() Russell King (Oracle)
2024-05-29 13:29 ` Russell King (Oracle) [this message]
2024-05-29 13:29 ` [PATCH net-next 3/6] net: phylink: rename ovr_an_inband to default_an_inband Russell King (Oracle)
2024-05-29 13:29 ` [PATCH net-next 4/6] net: fman_memac: remove the now unnecessary checking for fixed-link Russell King (Oracle)
2024-05-30 14:57   ` Sean Anderson
2024-05-29 13:29 ` [PATCH net-next 5/6] net: stmmac: rename xpcs_an_inband to default_an_inband Russell King (Oracle)
2024-05-29 13:29 ` [PATCH net-next 6/6] net: stmmac: dwmac-intel: remove checking for fixed link Russell King (Oracle)
2024-05-29 22:02 ` [PATCH net-next 0/6] net: phylink: rearrange ovr_an_inband support Andrew Halaney
2024-05-31  1:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1sCJMq-00Ecqv-P8@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux$(echo .)org.uk \
    --cc=ahalaney@redhat$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=fancer.lancer@gmail$(echo .)com \
    --cc=hkallweit1@gmail$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox