Skip to content

Commit e40dd46

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: clean up stmmac_disable_eee_mode()
stmmac_disable_eee_mode() is now only called from stmmac_xmit() when both priv->tx_path_in_lpi_mode and priv->eee_sw_timer_en are true. Therefore: if (!priv->eee_sw_timer_en) in stmmac_disable_eee_mode() will never be true, so this is dead code. Remove it, and rename the function to indicate that it now only deals with software based EEE mode. 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 80fada6 commit e40dd46

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,13 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
427427
}
428428

429429
/**
430-
* stmmac_disable_eee_mode - disable and exit from LPI mode
430+
* stmmac_disable_sw_eee_mode - disable and exit from LPI mode
431431
* @priv: driver private structure
432432
* Description: this function is to exit and disable EEE in case of
433433
* LPI state is true. This is called by the xmit.
434434
*/
435-
static void stmmac_disable_eee_mode(struct stmmac_priv *priv)
435+
static void stmmac_disable_sw_eee_mode(struct stmmac_priv *priv)
436436
{
437-
if (!priv->eee_sw_timer_en) {
438-
stmmac_lpi_entry_timer_config(priv, 0);
439-
return;
440-
}
441-
442437
stmmac_reset_eee_mode(priv, priv->hw);
443438
del_timer_sync(&priv->eee_ctrl_timer);
444439
priv->tx_path_in_lpi_mode = false;
@@ -4503,7 +4498,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
45034498
first_tx = tx_q->cur_tx;
45044499

45054500
if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
4506-
stmmac_disable_eee_mode(priv);
4501+
stmmac_disable_sw_eee_mode(priv);
45074502

45084503
/* Manage oversized TCP frames for GMAC4 device */
45094504
if (skb_is_gso(skb) && priv->tso) {

0 commit comments

Comments
 (0)