From: "Russell King (Oracle)" <rmk+kernel@armlinux•org.uk>
To: Andrew Lunn <andrew@lunn•ch>, Heiner Kallweit <hkallweit1@gmail•com>
Cc: "David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Florian Fainelli <f.fainelli@gmail•com>,
Jakub Kicinski <kuba@kernel•org>,
netdev@vger•kernel.org, Paolo Abeni <pabeni@redhat•com>,
Vladimir Oltean <olteanv@gmail•com>
Subject: [PATCH net-next 3/3] net: phylink: remove "using_mac_select_pcs"
Date: Tue, 08 Oct 2024 15:41:44 +0100 [thread overview]
Message-ID: <E1syBPE-006Unh-TL@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZwVEjCFsrxYuaJGz@shell.armlinux.org.uk>
With DSA's implementation of the mac_select_pcs() method removed, we
can now remove the detection of mac_select_pcs() implementation.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux•org.uk>
---
drivers/net/phy/phylink.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 4309317de3d1..8f86599d3d78 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -79,7 +79,6 @@ struct phylink {
unsigned int pcs_state;
bool mac_link_dropped;
- bool using_mac_select_pcs;
struct sfp_bus *sfp_bus;
bool sfp_may_have_phy;
@@ -661,12 +660,12 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl,
int ret;
/* Get the PCS for this interface mode */
- if (pl->using_mac_select_pcs) {
+ if (pl->mac_ops->mac_select_pcs) {
pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
if (IS_ERR(pcs))
return PTR_ERR(pcs);
} else {
- pcs = pl->pcs;
+ pcs = NULL;
}
if (pcs) {
@@ -1182,7 +1181,7 @@ static void phylink_major_config(struct phylink *pl, bool restart,
state->interface,
state->advertising);
- if (pl->using_mac_select_pcs) {
+ if (pl->mac_ops->mac_select_pcs) {
pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
if (IS_ERR(pcs)) {
phylink_err(pl,
@@ -1698,7 +1697,6 @@ struct phylink *phylink_create(struct phylink_config *config,
phy_interface_t iface,
const struct phylink_mac_ops *mac_ops)
{
- bool using_mac_select_pcs = false;
struct phylink *pl;
int ret;
@@ -1709,11 +1707,6 @@ struct phylink *phylink_create(struct phylink_config *config,
return ERR_PTR(-EINVAL);
}
- if (mac_ops->mac_select_pcs &&
- mac_ops->mac_select_pcs(config, PHY_INTERFACE_MODE_NA) !=
- ERR_PTR(-EOPNOTSUPP))
- using_mac_select_pcs = true;
-
pl = kzalloc(sizeof(*pl), GFP_KERNEL);
if (!pl)
return ERR_PTR(-ENOMEM);
@@ -1732,7 +1725,6 @@ struct phylink *phylink_create(struct phylink_config *config,
return ERR_PTR(-EINVAL);
}
- pl->using_mac_select_pcs = using_mac_select_pcs;
pl->phy_state.interface = iface;
pl->link_interface = iface;
if (iface == PHY_INTERFACE_MODE_MOCA)
--
2.30.2
next prev parent reply other threads:[~2024-10-08 14:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 14:41 [PATCH net-next 0/3] Removing more phylink cruft Russell King (Oracle)
2024-10-08 14:41 ` [PATCH net-next 1/3] net: dsa: remove dsa_port_phylink_mac_select_pcs() Russell King (Oracle)
2024-10-09 12:17 ` Vladimir Oltean
2024-10-08 14:41 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: return NULL when no PCS is present Russell King (Oracle)
2024-10-09 12:18 ` Vladimir Oltean
2024-10-08 14:41 ` Russell King (Oracle) [this message]
2024-10-09 12:29 ` [PATCH net-next 3/3] net: phylink: remove "using_mac_select_pcs" Vladimir Oltean
2024-10-09 12:33 ` Vladimir Oltean
2024-10-10 9:47 ` Paolo Abeni
2024-10-10 11:21 ` Russell King (Oracle)
2024-10-10 13:00 ` Russell King (Oracle)
2024-10-11 10:39 ` Vladimir Oltean
2024-10-11 10:58 ` Russell King (Oracle)
2024-10-11 12:54 ` Vladimir Oltean
2024-10-11 17:51 ` Russell King (Oracle)
2024-10-12 10:27 ` Vladimir Oltean
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=E1syBPE-006Unh-TL@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux$(echo .)org.uk \
--cc=andrew@lunn$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=hkallweit1@gmail$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=olteanv@gmail$(echo .)com \
--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