aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_qca.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-01-17 20:41:39 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-18 16:49:47 -0500
commit9520ed8fb8410dcb6babf751561a08f73ca03812 (patch)
treeee7e664f866902ca3befac6dc0294c755dfa3b2d /net/dsa/tag_qca.c
parentnet: dsa: store CPU switch structure in the tree (diff)
downloadlinux-dev-9520ed8fb8410dcb6babf751561a08f73ca03812.tar.xz
linux-dev-9520ed8fb8410dcb6babf751561a08f73ca03812.zip
net: dsa: use cpu_switch instead of ds[0]
Now that the DSA Ethernet switches are true Linux devices, the CPU switch is not necessarily the first one. If its address is higher than the second switch on the same MDIO bus, its index will be 1, not 0. Avoid any confusion by using dst->cpu_switch instead of dst->ds[0]. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_qca.c')
-rw-r--r--net/dsa/tag_qca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index 0c90cacee7aa..736ca8e8c31e 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -104,7 +104,7 @@ static int qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
/* This protocol doesn't support cascading multiple switches so it's
* safe to assume the switch is first in the tree
*/
- ds = dst->ds[0];
+ ds = dst->cpu_switch;
if (!ds)
goto out_drop;