summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/b53
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-10-26 18:22:51 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-27 18:00:09 +0300
commitbff7b688d5b10a8cb8cecefdea5e255408b78f2f (patch)
tree4a75ab18d7dcce75a12d337fb10693a3821b444a /drivers/net/dsa/b53
parent5bca178eed601cd4584c38c5290f7abbcacf3fb3 (diff)
downloadlinux-bff7b688d5b10a8cb8cecefdea5e255408b78f2f.tar.xz
net: dsa: add dsa_is_unused_port helper
As the comment above the chunk states, the b53 driver attempts to disable the unused ports. But using ds->enabled_port_mask is misleading, because this mask reports in fact the user ports. To avoid confusion and fix this, this patch introduces an explicit dsa_is_unused_port helper which ensures the corresponding bit is not masked in any of the switch port masks. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/b53')
-rw-r--r--drivers/net/dsa/b53/b53_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index b48cf0487b43..c74a50112551 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -873,7 +873,7 @@ static int b53_setup(struct dsa_switch *ds)
for (port = 0; port < dev->num_ports; port++) {
if (dsa_is_cpu_port(ds, port))
b53_enable_cpu_port(dev, port);
- else if (!(BIT(port) & ds->enabled_port_mask))
+ else if (dsa_is_unused_port(ds, port))
b53_disable_port(ds, port, NULL);
}