Skip to content

Commit

Permalink
net: dsa: remove phylink_validate() method
Browse files Browse the repository at this point in the history
As of now, no DSA driver uses a custom link mode validation procedure
anymore. So remove this DSA operation and let phylink determine what is
supported based on config->mac_capabilities (if provided by the driver).
Leave a comment why we left the code that we did, and that there is more
work to do.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed Nov 16, 2022
1 parent de8586e commit 53d04b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
3 changes: 0 additions & 3 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,6 @@ struct dsa_switch_ops {
*/
void (*phylink_get_caps)(struct dsa_switch *ds, int port,
struct phylink_config *config);
void (*phylink_validate)(struct dsa_switch *ds, int port,
unsigned long *supported,
struct phylink_link_state *state);
struct phylink_pcs *(*phylink_mac_select_pcs)(struct dsa_switch *ds,
int port,
phy_interface_t iface);
Expand Down
18 changes: 8 additions & 10 deletions net/dsa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,16 +1536,14 @@ static void dsa_port_phylink_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
struct dsa_port *dp = container_of(config, struct dsa_port, pl_config);
struct dsa_switch *ds = dp->ds;

if (!ds->ops->phylink_validate) {
if (config->mac_capabilities)
phylink_generic_validate(config, supported, state);
return;
}

ds->ops->phylink_validate(ds, dp->index, supported, state);
/* Skip call for drivers which don't yet set mac_capabilities,
* since validating in that case would mean their PHY will advertise
* nothing. In turn, skipping validation makes them advertise
* everything that the PHY supports, so those drivers should be
* converted ASAP.
*/
if (config->mac_capabilities)
phylink_generic_validate(config, supported, state);
}

static void dsa_port_phylink_mac_pcs_get_state(struct phylink_config *config,
Expand Down

0 comments on commit 53d04b9

Please sign in to comment.