summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2025-01-14 10:00:30 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2025-01-21 11:52:43 +0000
commita80ec0e8fc8658f7190079c4fa3ebc0c4365b834 (patch)
treef13fb68fc06a1da5dbed57b32ced0d8e838c7df1 /drivers/net/ethernet
parentba858e29f894c1ffc8be0de66aeb76860540a9e9 (diff)
net: stmmac: move priv->eee_active into stmmac_eee_init()
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. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Choong Yong Liang <yong.liang.choong@linux.intel.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1tVZER-0002Kv-5O@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e7fffee2892b..83d20dc5d8a7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -456,13 +456,16 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
/**
* stmmac_eee_init - init EEE
* @priv: driver private structure
+ * @active: indicates whether EEE should be enabled.
* Description:
* if the GMAC supports the EEE (from the HW cap reg) and the phy device
* 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;
@@ -969,8 +972,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))
@@ -1082,8 +1084,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);
}