]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: remove unnecessary checks in ethtool eee ops
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 15 Aug 2025 11:31:50 +0000 (12:31 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Aug 2025 01:10:11 +0000 (18:10 -0700)
Phylink will check whether the MAC supports the LPI methods in
struct phylink_mac_ops, and return -EOPNOTSUPP if the LPI capabilities
are not provided. stmmac doesn't provide LPI capabilities if
priv->dma_cap.eee is not set.

Therefore, checking the state of priv->dma_cap.eee in the ethtool ops
and returning -EOPNOTSUPP is redundant - let phylink handle this.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1umsf0-008vKK-A3@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 77758a7299b4ebbe5be754490a00b6187dcdb8fc..dda7ba1f524d995d8e4725d261fe1929527c7100 100644 (file)
@@ -852,9 +852,6 @@ static int stmmac_ethtool_op_get_eee(struct net_device *dev,
 {
        struct stmmac_priv *priv = netdev_priv(dev);
 
-       if (!priv->dma_cap.eee)
-               return -EOPNOTSUPP;
-
        return phylink_ethtool_get_eee(priv->phylink, edata);
 }
 
@@ -863,9 +860,6 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev,
 {
        struct stmmac_priv *priv = netdev_priv(dev);
 
-       if (!priv->dma_cap.eee)
-               return -EOPNOTSUPP;
-
        return phylink_ethtool_set_eee(priv->phylink, edata);
 }