]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: stmmac: remove redundant code from ethtool EEE ops
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 8 Jan 2025 16:47:59 +0000 (16:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Jan 2025 01:51:01 +0000 (17:51 -0800)
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 <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/E1tVZDr-0002KF-Cv@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index e2584fc9ce4ee0a94ab7b71e4d1c1993bc948560..b50f48e17f4c45158f3780988694004fae86c359 100644 (file)
@@ -405,7 +405,6 @@ void stmmac_dvr_remove(struct device *dev);
 int stmmac_dvr_probe(struct device *device,
                     struct plat_stmmacenet_data *plat_dat,
                     struct stmmac_resources *res);
-void stmmac_disable_eee_mode(struct stmmac_priv *priv);
 int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt);
 int stmmac_reinit_ringparam(struct net_device *dev, u32 rx_size, u32 tx_size);
 int stmmac_bus_clks_config(struct stmmac_priv *priv, bool enabled);
index 0429a99a8114da512bbc3bbdeb04808ba7642d6a..693f59c3c47af77234cdb6d3448b19d10e4f7198 100644 (file)
@@ -898,8 +898,6 @@ static int stmmac_ethtool_op_get_eee(struct net_device *dev,
        if (!priv->dma_cap.eee)
                return -EOPNOTSUPP;
 
-       edata->tx_lpi_enabled = priv->tx_lpi_enabled;
-
        return phylink_ethtool_get_eee(priv->phylink, edata);
 }
 
@@ -911,13 +909,6 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev,
        if (!priv->dma_cap.eee)
                return -EOPNOTSUPP;
 
-       if (priv->tx_lpi_enabled != edata->tx_lpi_enabled)
-               netdev_warn(priv->dev,
-                           "Setting EEE tx-lpi is not supported\n");
-
-       if (!edata->eee_enabled)
-               stmmac_disable_eee_mode(priv);
-
        return phylink_ethtool_set_eee(priv->phylink, edata);
 }
 
index 51799eb672f7038ccb96a5ac36c8d45e63f65d9c..ee394cc2fb504d90b2aa7eb92ab73cfdda5c50aa 100644 (file)
@@ -432,7 +432,7 @@ static int stmmac_enable_eee_mode(struct stmmac_priv *priv)
  * Description: this function is to exit and disable EEE in case of
  * LPI state is true. This is called by the xmit.
  */
-void stmmac_disable_eee_mode(struct stmmac_priv *priv)
+static void stmmac_disable_eee_mode(struct stmmac_priv *priv)
 {
        if (!priv->eee_sw_timer_en) {
                stmmac_lpi_entry_timer_config(priv, 0);