diff mbox series

[net] net: dsa: Fix dsa_is_user_port() test inversion

Message ID 1520895640-28139-1-git-send-email-f.fainelli@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] net: dsa: Fix dsa_is_user_port() test inversion | expand

Commit Message

Florian Fainelli March 12, 2018, 11 p.m. UTC
During the conversion to dsa_is_user_port(), a condition ended up being
reversed, which would prevent the creation of any user port when using
the legacy binding and/or platform data, fix that.

Fixes: 4a5b85ffe2a0 ("net: dsa: use dsa_is_user_port everywhere")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/legacy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 13, 2018, 1:06 a.m. UTC | #1
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 12 Mar 2018 16:00:40 -0700

> During the conversion to dsa_is_user_port(), a condition ended up being
> reversed, which would prevent the creation of any user port when using
> the legacy binding and/or platform data, fix that.
> 
> Fixes: 4a5b85ffe2a0 ("net: dsa: use dsa_is_user_port everywhere")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied and queued up for -stable, thanks Florian.
diff mbox series

Patch

diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
index cb54b81d0bd9..42a7b85b84e1 100644
--- a/net/dsa/legacy.c
+++ b/net/dsa/legacy.c
@@ -194,7 +194,7 @@  static int dsa_switch_setup_one(struct dsa_switch *ds,
 		ds->ports[i].dn = cd->port_dn[i];
 		ds->ports[i].cpu_dp = dst->cpu_dp;
 
-		if (dsa_is_user_port(ds, i))
+		if (!dsa_is_user_port(ds, i))
 			continue;
 
 		ret = dsa_slave_create(&ds->ports[i]);