aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-08-01 16:32:34 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-01 20:09:09 -0700
commita2444ab83eb4ada01a3b35749cfc581130027816 (patch)
tree10a034912fbed1cbde9bba702d5405d6fcbd82cd /drivers/net/dsa
parentnet: dsa: qca8k: enable EEE once (diff)
downloadlinux-dev-a2444ab83eb4ada01a3b35749cfc581130027816.tar.xz
linux-dev-a2444ab83eb4ada01a3b35749cfc581130027816.zip
net: dsa: qca8k: do not cache unneeded EEE fields
The qca8k driver is currently caching a bitfield of the supported member of a ethtool_eee private structure, which is unused. Only the eee_enabled field of the private ethtool_eee copy is updated, thus using p->advertised and p->lp_advertised is also erroneous. Remove the usage of these private ethtool_eee members and only rely on phy_ethtool_get_eee to assign the eee_active member. 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.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 9d6b5d2f7a4a..c316c55aabc6 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -658,12 +658,8 @@ static int
qca8k_eee_init(struct dsa_switch *ds, int port,
struct phy_device *phy)
{
- struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
- struct ethtool_eee *p = &priv->port_sts[port].eee;
int ret;
- p->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full);
-
ret = phy_init_eee(phy, 0);
if (ret)
return 0;
@@ -705,12 +701,7 @@ qca8k_get_eee(struct dsa_switch *ds, int port,
int ret;
ret = phy_ethtool_get_eee(netdev->phydev, p);
- if (!ret)
- e->eee_active =
- !!(p->supported & p->advertised & p->lp_advertised);
- else
- e->eee_active = 0;
-
+ e->eee_active = p->eee_active;
e->eee_enabled = p->eee_enabled;
return ret;