From 27dd9da5270e825fadd193b534742d46976267df Mon Sep 17 00:00:00 2001 From: "Russell King (Oracle)" Date: Thu, 9 Jun 2022 13:53:32 +0100 Subject: net: phylink: remove legacy mac_an_restart() method The mac_an_restart() method is now completely unused, and has been superseded by phylink_pcs support. Remove this method. Since phylink_pcs_mac_an_restart() now only deals with the PCS, rename the function to remove the _mac infix. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 20 ++++++++------------ include/linux/phylink.h | 12 ------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index cacce8539a48..9f53a723e6a0 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -823,16 +823,12 @@ static void phylink_mac_config(struct phylink *pl, pl->mac_ops->mac_config(pl->config, pl->cur_link_an_mode, state); } -static void phylink_mac_pcs_an_restart(struct phylink *pl) +static void phylink_pcs_an_restart(struct phylink *pl) { - if (pl->link_config.an_enabled && + if (pl->pcs && pl->link_config.an_enabled && phy_interface_mode_is_8023z(pl->link_config.interface) && - phylink_autoneg_inband(pl->cur_link_an_mode)) { - if (pl->pcs) - pl->pcs->ops->pcs_an_restart(pl->pcs); - else if (pl->config->legacy_pre_march2020) - pl->mac_ops->mac_an_restart(pl->config); - } + phylink_autoneg_inband(pl->cur_link_an_mode)) + pl->pcs->ops->pcs_an_restart(pl->pcs); } static void phylink_major_config(struct phylink *pl, bool restart, @@ -901,7 +897,7 @@ static void phylink_major_config(struct phylink *pl, bool restart, restart = true; } if (restart) - phylink_mac_pcs_an_restart(pl); + phylink_pcs_an_restart(pl); if (pl->mac_ops->mac_finish) { err = pl->mac_ops->mac_finish(pl->config, pl->cur_link_an_mode, @@ -930,7 +926,7 @@ static int phylink_change_inband_advert(struct phylink *pl) if (!pl->pcs && pl->config->legacy_pre_march2020) { /* Legacy method */ phylink_mac_config(pl, &pl->link_config); - phylink_mac_pcs_an_restart(pl); + phylink_pcs_an_restart(pl); return 0; } @@ -953,7 +949,7 @@ static int phylink_change_inband_advert(struct phylink *pl) return ret; if (ret > 0) - phylink_mac_pcs_an_restart(pl); + phylink_pcs_an_restart(pl); return 0; } @@ -2145,7 +2141,7 @@ int phylink_ethtool_nway_reset(struct phylink *pl) if (pl->phydev) ret = phy_restart_aneg(pl->phydev); - phylink_mac_pcs_an_restart(pl); + phylink_pcs_an_restart(pl); return ret; } diff --git a/include/linux/phylink.h b/include/linux/phylink.h index ec7aa5d54dda..3e4acd97748e 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -134,7 +134,6 @@ struct phylink_config { * @mac_prepare: prepare for a major reconfiguration of the interface. * @mac_config: configure the MAC for the selected mode and state. * @mac_finish: finish a major reconfiguration of the interface. - * @mac_an_restart: restart 802.3z BaseX autonegotiation. * @mac_link_down: take the link down. * @mac_link_up: allow the link to come up. * @@ -154,7 +153,6 @@ struct phylink_mac_ops { const struct phylink_link_state *state); int (*mac_finish)(struct phylink_config *config, unsigned int mode, phy_interface_t iface); - void (*mac_an_restart)(struct phylink_config *config); void (*mac_link_down)(struct phylink_config *config, unsigned int mode, phy_interface_t interface); void (*mac_link_up)(struct phylink_config *config, @@ -354,16 +352,6 @@ void mac_config(struct phylink_config *config, unsigned int mode, int mac_finish(struct phylink_config *config, unsigned int mode, phy_interface_t iface); -/** - * mac_an_restart() - restart 802.3z BaseX autonegotiation - * @config: a pointer to a &struct phylink_config. - * - * Note: This is a legacy method. This function will not be called unless - * legacy_pre_march2020 is set in &struct phylink_config and there is no - * PCS attached. - */ -void mac_an_restart(struct phylink_config *config); - /** * mac_link_down() - take the link down * @config: a pointer to a &struct phylink_config. -- cgit