Skip to content

Commit

Permalink
net: dsa: qca8k: enable EEE once
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vivien Didelot authored and David S. Miller committed Aug 2, 2017
1 parent 06d7b5c commit dca2098
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dca2098

Please sign in to comment.