From: Russell King (Oracle) Date: Tue, 10 Dec 2024 14:18:52 +0000 (+0000) Subject: net: dsa: require .support_eee() method to be implemented X-Git-Tag: v6.14-rc1~162^2~233^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88325a291a0cd077bf49b889af605e683b5f956e;p=thirdparty%2Flinux.git net: dsa: require .support_eee() method to be implemented Now that we have updated all drivers, switch DSA to require an implementation of the .support_eee() method for EEE to be usable, rather than defaulting to being permissive when not implemented. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://patch.msgid.link/E1tL14e-006cZy-AT@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- diff --git a/net/dsa/user.c b/net/dsa/user.c index a743396800104..4a8de48a6f249 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1230,7 +1230,7 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Check whether the switch supports EEE */ - if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + 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 */ @@ -1254,7 +1254,7 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Check whether the switch supports EEE */ - if (ds->ops->support_eee && !ds->ops->support_eee(ds, dp->index)) + 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 */