diff mbox series

[RFC,net-next,2/7] net: dsa: no longer call ds->ops->get_mac_eee()

Message ID E1tL1Br-006cnA-KV@rmk-PC.armlinux.org.uk (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: cleanup EEE (part 2) | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/apply fail Patch does not apply to net-next-1

Commit Message

Russell King (Oracle) Dec. 10, 2024, 2:26 p.m. UTC
All implementations of get_mac_eee() now just return zero without doing
anything useful. Remove the call to this method in preparation to
removing the method from each DSA driver.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 net/dsa/user.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Vladimir Oltean Dec. 12, 2024, 7:44 p.m. UTC | #1
On Tue, Dec 10, 2024 at 02:26:19PM +0000, Russell King (Oracle) wrote:
> All implementations of get_mac_eee() now just return zero without doing
> anything useful. Remove the call to this method in preparation to
> removing the method from each DSA driver.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  net/dsa/user.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/net/dsa/user.c b/net/dsa/user.c
> index 4239083c18bf..fb38543b29db 100644
> --- a/net/dsa/user.c
> +++ b/net/dsa/user.c
> @@ -1250,23 +1250,11 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e)
>  {
>  	struct dsa_port *dp = dsa_user_to_port(dev);
>  	struct dsa_switch *ds = dp->ds;
> -	int ret;
>  
>  	/* Check whether the switch supports EEE */
>  	if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index))
>  		return -EOPNOTSUPP;
>  
> -	/* Port's PHY and MAC both need to be EEE capable */
> -	if (!dev->phydev)
> -		return -ENODEV;

It may well be that removing this test is ok given the later call to
phylink_ethtool_get_eee() which will fail with the same return code,
but this change does not logically pertain to a patch titled
"no longer call ds->ops->get_mac_eee()", and no justification is brought
for it in the commit message (my previous sentence should be sufficient).
Please move this to a separate patch, for traceability purposes.

> -
> -	if (!ds->ops->get_mac_eee)
> -		return -EOPNOTSUPP;
> -
> -	ret = ds->ops->get_mac_eee(ds, dp->index, e);
> -	if (ret)
> -		return ret;
> -
>  	return phylink_ethtool_get_eee(dp->pl, e);
>  }
>  
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/net/dsa/user.c b/net/dsa/user.c
index 4239083c18bf..fb38543b29db 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -1250,23 +1250,11 @@  static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e)
 {
 	struct dsa_port *dp = dsa_user_to_port(dev);
 	struct dsa_switch *ds = dp->ds;
-	int ret;
 
 	/* Check whether the switch supports EEE */
 	if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index))
 		return -EOPNOTSUPP;
 
-	/* Port's PHY and MAC both need to be EEE capable */
-	if (!dev->phydev)
-		return -ENODEV;
-
-	if (!ds->ops->get_mac_eee)
-		return -EOPNOTSUPP;
-
-	ret = ds->ops->get_mac_eee(ds, dp->index, e);
-	if (ret)
-		return ret;
-
 	return phylink_ethtool_get_eee(dp->pl, e);
 }