[PATCH net-next v2 12/17] net: stmmac: move priv->eee_active into stmmac_eee_init()
Russell King (Oracle)
rmk+kernel at armlinux.org.uk
Mon Jan 6 04:25:45 PST 2025
Since all call sites of stmmac_eee_init() assign priv->eee_active
immediately before, pass this state into stmmac_eee_init() and
assign priv->eee_active within this function.
Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cf294fe3f726..1aedb49944ec 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -464,8 +464,10 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
* can also manage EEE, this function enable the LPI state and start related
* timer.
*/
-static void stmmac_eee_init(struct stmmac_priv *priv)
+static void stmmac_eee_init(struct stmmac_priv *priv, bool active)
{
+ priv->eee_active = active;
+
/* Check if MAC core supports the EEE feature. */
if (!priv->dma_cap.eee) {
priv->eee_enabled = false;
@@ -972,8 +974,7 @@ static void stmmac_mac_link_down(struct phylink_config *config,
struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
stmmac_mac_set(priv, priv->ioaddr, false);
- priv->eee_active = false;
- stmmac_eee_init(priv);
+ stmmac_eee_init(priv, false);
stmmac_set_eee_pls(priv, priv->hw, false);
if (stmmac_fpe_supported(priv))
@@ -1085,8 +1086,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
phy_eee_rx_clock_stop(phy, !(priv->plat->flags &
STMMAC_FLAG_RX_CLK_RUNS_IN_LPI));
priv->tx_lpi_timer = phy->eee_cfg.tx_lpi_timer;
- priv->eee_active = phy->enable_tx_lpi;
- stmmac_eee_init(priv);
+ stmmac_eee_init(priv, phy->enable_tx_lpi);
stmmac_set_eee_pls(priv, priv->hw, true);
}
--
2.30.2
More information about the linux-arm-kernel
mailing list