Skip to content

Commit 2914a5c

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: remove priv->eee_tw_timer
priv->eee_tw_timer is only assigned during initialisation to a constant value (STMMAC_DEFAULT_TWT_LS) and then never changed. Remove priv->eee_tw_timer, and instead use STMMAC_DEFAULT_TWT_LS for both uses in stmmac_eee_init(). 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 a324217 commit 2914a5c

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ struct stmmac_priv {
308308
int eee_enabled;
309309
int eee_active;
310310
u32 tx_lpi_timer;
311-
int eee_tw_timer;
312311
bool eee_sw_timer_en;
313312
unsigned int mode;
314313
unsigned int chain_mode;

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,6 @@ static void stmmac_eee_ctrl_timer(struct timer_list *t)
464464
*/
465465
static bool stmmac_eee_init(struct stmmac_priv *priv)
466466
{
467-
int eee_tw_timer = priv->eee_tw_timer;
468-
469467
/* Check if MAC core supports the EEE feature. */
470468
if (!priv->dma_cap.eee)
471469
return false;
@@ -478,7 +476,8 @@ static bool stmmac_eee_init(struct stmmac_priv *priv)
478476
netdev_dbg(priv->dev, "disable EEE\n");
479477
stmmac_lpi_entry_timer_config(priv, 0);
480478
del_timer_sync(&priv->eee_ctrl_timer);
481-
stmmac_set_eee_timer(priv, priv->hw, 0, eee_tw_timer);
479+
stmmac_set_eee_timer(priv, priv->hw, 0,
480+
STMMAC_DEFAULT_TWT_LS);
482481
if (priv->hw->xpcs)
483482
xpcs_config_eee(priv->hw->xpcs,
484483
priv->plat->mult_fact_100ns,
@@ -491,7 +490,7 @@ static bool stmmac_eee_init(struct stmmac_priv *priv)
491490
if (priv->eee_active && !priv->eee_enabled) {
492491
timer_setup(&priv->eee_ctrl_timer, stmmac_eee_ctrl_timer, 0);
493492
stmmac_set_eee_timer(priv, priv->hw, STMMAC_DEFAULT_LIT_LS,
494-
eee_tw_timer);
493+
STMMAC_DEFAULT_TWT_LS);
495494
if (priv->hw->xpcs)
496495
xpcs_config_eee(priv->hw->xpcs,
497496
priv->plat->mult_fact_100ns,
@@ -3454,8 +3453,6 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
34543453
else if (ptp_register)
34553454
stmmac_ptp_register(priv);
34563455

3457-
priv->eee_tw_timer = STMMAC_DEFAULT_TWT_LS;
3458-
34593456
if (priv->use_riwt) {
34603457
u32 queue;
34613458

0 commit comments

Comments
 (0)