]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/dsa/dsa2.c
Merge tag 'driver-core-4.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / net / dsa / dsa2.c
index 56e46090526bb3baf26b5e06478cdd66ccc94280..c442051d5a55732d37ddc18187389d66d8d08bd9 100644 (file)
@@ -509,21 +509,22 @@ static int dsa_cpu_parse(struct dsa_port *port, u32 index,
                dst->cpu_dp->netdev = ethernet_dev;
        }
 
+       /* Initialize cpu_port_mask now for drv->setup()
+        * to have access to a correct value, just like what
+        * net/dsa/dsa.c::dsa_switch_setup_one does.
+        */
+       ds->cpu_port_mask |= BIT(index);
+
        tag_protocol = ds->ops->get_tag_protocol(ds);
        dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
        if (IS_ERR(dst->tag_ops)) {
                dev_warn(ds->dev, "No tagger for this switch\n");
+               ds->cpu_port_mask &= ~BIT(index);
                return PTR_ERR(dst->tag_ops);
        }
 
        dst->rcv = dst->tag_ops->rcv;
 
-       /* Initialize cpu_port_mask now for drv->setup()
-        * to have access to a correct value, just like what
-        * net/dsa/dsa.c::dsa_switch_setup_one does.
-        */
-       ds->cpu_port_mask |= BIT(index);
-
        return 0;
 }