Skip to content

Commit 80fada6

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: remove redundant code from ethtool EEE ops
Setting edata->tx_lpi_enabled in stmmac_ethtool_op_get_eee() gets overwritten by phylib, so there's no point setting this. In stmmac_ethtool_op_set_eee(), now that stmmac is using the result of phylib's evaluation of EEE, there is no need to handle anything in the ethtool EEE ops other than calling through to the appropriate phylink function, which will pass on to phylib the users request. As stmmac_disable_eee_mode() is now no longer called from outside stmmac_main.c, make it static. 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 beb1e01 commit 80fada6

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ void stmmac_dvr_remove(struct device *dev);
405405
int stmmac_dvr_probe(struct device *device,
406406
struct plat_stmmacenet_data *plat_dat,
407407
struct stmmac_resources *res);
408-
void stmmac_disable_eee_mode(struct stmmac_priv *priv);
409408
int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt);
410409
int stmmac_reinit_ringparam(struct net_device *dev, u32 rx_size, u32 tx_size);
411410
int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled);

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,6 @@ static int stmmac_ethtool_op_get_eee(struct net_device *dev,
898898
if (!priv->dma_cap.eee)
899899
return -EOPNOTSUPP;
900900

901-
edata->tx_lpi_enabled = priv->tx_lpi_enabled;
902-
903901
return phylink_ethtool_get_eee(priv->phylink, edata);
904902
}
905903

@@ -911,13 +909,6 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev,
911909
if (!priv->dma_cap.eee)
912910
return -EOPNOTSUPP;
913911

914-
if (priv->tx_lpi_enabled != edata->tx_lpi_enabled)
915-
netdev_warn(priv->dev,
916-
"Setting EEE tx-lpi is not supported\n");
917-
918-
if (!edata->eee_enabled)
919-
stmmac_disable_eee_mode(priv);
920-
921912
return phylink_ethtool_set_eee(priv->phylink, edata);
922913
}
923914

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
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-
void stmmac_disable_eee_mode(struct stmmac_priv *priv)
435+
static void stmmac_disable_eee_mode(struct stmmac_priv *priv)
436436
{
437437
if (!priv->eee_sw_timer_en) {
438438
stmmac_lpi_entry_timer_config(priv, 0);

0 commit comments

Comments
 (0)