summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-08-01 23:32:33 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-02 06:09:09 +0300
commitdca20989313aba3288e3a1d3a88007ccafb37e25 (patch)
tree2ec531a7162a687f43060ef322c5d6a2103689d4 /drivers/net/dsa
parent06d7b5c3acee7b42cd9aa47165587b9c1fb992d3 (diff)
downloadlinux-dca20989313aba3288e3a1d3a88007ccafb37e25.tar.xz
net: dsa: qca8k: enable EEE once
If EEE is queried enabled, qca8k_set_eee calls qca8k_eee_enable_set twice (because it is already called in qca8k_eee_init). Fix that. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/qca8k.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index e076ab23d4df..9d6b5d2f7a4a 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -684,12 +684,13 @@ qca8k_set_eee(struct dsa_switch *ds, int port,
p->eee_enabled = e->eee_enabled;
- if (e->eee_enabled) {
+ if (!p->eee_enabled) {
+ qca8k_eee_enable_set(ds, port, false);
+ } else {
p->eee_enabled = qca8k_eee_init(ds, port, phydev);
if (!p->eee_enabled)
ret = -EOPNOTSUPP;
}
- qca8k_eee_enable_set(ds, port, p->eee_enabled);
return ret;
}