Commit 4f1dd48f authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: phylink: remove pcs_ops member

Remove the pcs_ops member from struct phylink, using the one stored in
struct phylink_pcs instead.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent af9784d0
...@@ -43,7 +43,6 @@ struct phylink { ...@@ -43,7 +43,6 @@ struct phylink {
/* private: */ /* private: */
struct net_device *netdev; struct net_device *netdev;
const struct phylink_mac_ops *mac_ops; const struct phylink_mac_ops *mac_ops;
const struct phylink_pcs_ops *pcs_ops;
struct phylink_config *config; struct phylink_config *config;
struct phylink_pcs *pcs; struct phylink_pcs *pcs;
struct device *dev; struct device *dev;
...@@ -779,8 +778,8 @@ static void phylink_mac_pcs_an_restart(struct phylink *pl) ...@@ -779,8 +778,8 @@ static void phylink_mac_pcs_an_restart(struct phylink *pl)
if (pl->link_config.an_enabled && if (pl->link_config.an_enabled &&
phy_interface_mode_is_8023z(pl->link_config.interface) && phy_interface_mode_is_8023z(pl->link_config.interface) &&
phylink_autoneg_inband(pl->cur_link_an_mode)) { phylink_autoneg_inband(pl->cur_link_an_mode)) {
if (pl->pcs_ops) if (pl->pcs)
pl->pcs_ops->pcs_an_restart(pl->pcs); pl->pcs->ops->pcs_an_restart(pl->pcs);
else if (pl->config->legacy_pre_march2020) else if (pl->config->legacy_pre_march2020)
pl->mac_ops->mac_an_restart(pl->config); pl->mac_ops->mac_an_restart(pl->config);
} }
...@@ -819,7 +818,6 @@ static void phylink_major_config(struct phylink *pl, bool restart, ...@@ -819,7 +818,6 @@ static void phylink_major_config(struct phylink *pl, bool restart,
*/ */
if (pcs) { if (pcs) {
pl->pcs = pcs; pl->pcs = pcs;
pl->pcs_ops = pcs->ops;
if (!pl->phylink_disable_state && if (!pl->phylink_disable_state &&
pl->cfg_link_an_mode == MLO_AN_INBAND) { pl->cfg_link_an_mode == MLO_AN_INBAND) {
...@@ -832,8 +830,8 @@ static void phylink_major_config(struct phylink *pl, bool restart, ...@@ -832,8 +830,8 @@ static void phylink_major_config(struct phylink *pl, bool restart,
phylink_mac_config(pl, state); phylink_mac_config(pl, state);
if (pl->pcs_ops) { if (pl->pcs) {
err = pl->pcs_ops->pcs_config(pl->pcs, pl->cur_link_an_mode, err = pl->pcs->ops->pcs_config(pl->pcs, pl->cur_link_an_mode,
state->interface, state->interface,
state->advertising, state->advertising,
!!(pl->link_config.pause & !!(pl->link_config.pause &
...@@ -869,7 +867,7 @@ static int phylink_change_inband_advert(struct phylink *pl) ...@@ -869,7 +867,7 @@ static int phylink_change_inband_advert(struct phylink *pl)
if (test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state)) if (test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state))
return 0; return 0;
if (!pl->pcs_ops && pl->config->legacy_pre_march2020) { if (!pl->pcs && pl->config->legacy_pre_march2020) {
/* Legacy method */ /* Legacy method */
phylink_mac_config(pl, &pl->link_config); phylink_mac_config(pl, &pl->link_config);
phylink_mac_pcs_an_restart(pl); phylink_mac_pcs_an_restart(pl);
...@@ -886,10 +884,11 @@ static int phylink_change_inband_advert(struct phylink *pl) ...@@ -886,10 +884,11 @@ static int phylink_change_inband_advert(struct phylink *pl)
* restart negotiation if the pcs_config() helper indicates that * restart negotiation if the pcs_config() helper indicates that
* the programmed advertisement has changed. * the programmed advertisement has changed.
*/ */
ret = pl->pcs_ops->pcs_config(pl->pcs, pl->cur_link_an_mode, ret = pl->pcs->ops->pcs_config(pl->pcs, pl->cur_link_an_mode,
pl->link_config.interface, pl->link_config.interface,
pl->link_config.advertising, pl->link_config.advertising,
!!(pl->link_config.pause & MLO_PAUSE_AN)); !!(pl->link_config.pause &
MLO_PAUSE_AN));
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -918,8 +917,8 @@ static void phylink_mac_pcs_get_state(struct phylink *pl, ...@@ -918,8 +917,8 @@ static void phylink_mac_pcs_get_state(struct phylink *pl,
state->an_complete = 0; state->an_complete = 0;
state->link = 1; state->link = 1;
if (pl->pcs_ops) if (pl->pcs)
pl->pcs_ops->pcs_get_state(pl->pcs, state); pl->pcs->ops->pcs_get_state(pl->pcs, state);
else if (pl->mac_ops->mac_pcs_get_state && else if (pl->mac_ops->mac_pcs_get_state &&
pl->config->legacy_pre_march2020) pl->config->legacy_pre_march2020)
pl->mac_ops->mac_pcs_get_state(pl->config, state); pl->mac_ops->mac_pcs_get_state(pl->config, state);
...@@ -992,8 +991,8 @@ static void phylink_link_up(struct phylink *pl, ...@@ -992,8 +991,8 @@ static void phylink_link_up(struct phylink *pl,
pl->cur_interface = link_state.interface; pl->cur_interface = link_state.interface;
if (pl->pcs_ops && pl->pcs_ops->pcs_link_up) if (pl->pcs && pl->pcs->ops->pcs_link_up)
pl->pcs_ops->pcs_link_up(pl->pcs, pl->cur_link_an_mode, pl->pcs->ops->pcs_link_up(pl->pcs, pl->cur_link_an_mode,
pl->cur_interface, pl->cur_interface,
link_state.speed, link_state.duplex); link_state.speed, link_state.duplex);
...@@ -1115,7 +1114,7 @@ static void phylink_resolve(struct work_struct *w) ...@@ -1115,7 +1114,7 @@ static void phylink_resolve(struct work_struct *w)
} }
phylink_major_config(pl, false, &link_state); phylink_major_config(pl, false, &link_state);
pl->link_config.interface = link_state.interface; pl->link_config.interface = link_state.interface;
} else if (!pl->pcs_ops && pl->config->legacy_pre_march2020) { } else if (!pl->pcs && pl->config->legacy_pre_march2020) {
/* The interface remains unchanged, only the speed, /* The interface remains unchanged, only the speed,
* duplex or pause settings have changed. Call the * duplex or pause settings have changed. Call the
* old mac_config() method to configure the MAC/PCS * old mac_config() method to configure the MAC/PCS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment