Skip to content

Commit 1797dd4

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
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 <[email protected]> Tested-by: Choong Yong Liang <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0a900ea commit 1797dd4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,16 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
457457
/**
458458
* stmmac_eee_init - init EEE
459459
* @priv: driver private structure
460+
* @active: indicates whether EEE should be enabled.
460461
* Description:
461462
* if the GMAC supports the EEE (from the HW cap reg) and the phy device
462463
* can also manage EEE, this function enable the LPI state and start related
463464
* timer.
464465
*/
465-
static void stmmac_eee_init(struct stmmac_priv *priv)
466+
static void stmmac_eee_init(struct stmmac_priv *priv, bool active)
466467
{
468+
priv->eee_active = active;
469+
467470
/* Check if MAC core supports the EEE feature. */
468471
if (!priv->dma_cap.eee) {
469472
priv->eee_enabled = false;
@@ -970,8 +973,7 @@ static void stmmac_mac_link_down(struct phylink_config *config,
970973
struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
971974

972975
stmmac_mac_set(priv, priv->ioaddr, false);
973-
priv->eee_active = false;
974-
stmmac_eee_init(priv);
976+
stmmac_eee_init(priv, false);
975977
stmmac_set_eee_pls(priv, priv->hw, false);
976978

977979
if (stmmac_fpe_supported(priv))
@@ -1083,8 +1085,7 @@ static void stmmac_mac_link_up(struct phylink_config *config,
10831085
phy_eee_rx_clock_stop(phy, !(priv->plat->flags &
10841086
STMMAC_FLAG_RX_CLK_RUNS_IN_LPI));
10851087
priv->tx_lpi_timer = phy->eee_cfg.tx_lpi_timer;
1086-
priv->eee_active = phy->enable_tx_lpi;
1087-
stmmac_eee_init(priv);
1088+
stmmac_eee_init(priv, phy->enable_tx_lpi);
10881089
stmmac_set_eee_pls(priv, priv->hw, true);
10891090
}
10901091

0 commit comments

Comments
 (0)