]> git.hungrycats.org Git - linux/commitdiff
net: dsa: Fix dsa_is_user_port() test inversion
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 12 Mar 2018 23:00:40 +0000 (16:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Mar 2018 16:05:41 +0000 (18:05 +0200)
[ Upstream commit 5a9f8df68ee6927f21dd3f2c75c16feb8b53a9e8 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dsa/legacy.c

index 84611d7fcfa2c973c02b08b55e048d69ca4837c1..3c9cee268b8a6cd05dbfdb05331c05ec2f70bc93 100644 (file)
@@ -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]);