summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-08-01 16:32:38 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-01 20:09:10 -0700
commitc48f7eb3021c993cfb15ee4963df2fd6683c2f0d (patch)
treead6033802a725c8e21bc774f5570aea6fb6b9e6e /net/dsa
parent7f5c6d7cdda7b67b11659cb5d2cfbaf5210d2fa8 (diff)
net: dsa: call phy_init_eee in DSA layer
All DSA drivers are calling phy_init_eee if eee_enabled is true. Move up this statement in the DSA layer to simplify the DSA drivers. qca8k does not require to cache the ethtool_eee structures from now on. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 7df55d597740..ad5caaf384d7 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -659,6 +659,12 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
if (ret)
return ret;
+ if (e->eee_enabled) {
+ ret = phy_init_eee(p->phy, 0);
+ if (ret)
+ return ret;
+ }
+
return phy_ethtool_set_eee(p->phy, e);
}