fold dentry_rcuwalk_invalidate() into its only remaining caller
[cascardo/linux.git] / net / dsa / dsa2.c
index 4e0f3c2..f30bad9 100644 (file)
@@ -394,6 +394,10 @@ static int dsa_dst_apply(struct dsa_switch_tree *dst)
                        return err;
        }
 
+       err = dsa_cpu_port_ethtool_setup(dst->ds[0]);
+       if (err)
+               return err;
+
        /* If we use a tagging format that doesn't have an ethertype
         * field, make sure that all packets from this point on get
         * sent to the tag format's receive function.
@@ -429,6 +433,8 @@ static void dsa_dst_unapply(struct dsa_switch_tree *dst)
                dsa_ds_unapply(dst, ds);
        }
 
+       dsa_cpu_port_ethtool_restore(dst->ds[0]);
+
        pr_info("DSA: tree %d unapplied\n", dst->tree);
        dst->applied = false;
 }
@@ -589,7 +595,7 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
        struct device_node *ports = dsa_get_ports(ds, np);
        struct dsa_switch_tree *dst;
        u32 tree, index;
-       int err;
+       int i, err;
 
        err = dsa_parse_member(np, &tree, &index);
        if (err)
@@ -616,6 +622,11 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
 
        ds->dst = dst;
        ds->index = index;
+
+       /* Initialize the routing table */
+       for (i = 0; i < DSA_MAX_SWITCHES; ++i)
+               ds->rtable[i] = DSA_RTABLE_NONE;
+
        dsa_dst_add_ds(dst, ds, index);
 
        err = dsa_dst_complete(dst);
@@ -666,7 +677,7 @@ int dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
 }
 EXPORT_SYMBOL_GPL(dsa_register_switch);
 
-void _dsa_unregister_switch(struct dsa_switch *ds)
+static void _dsa_unregister_switch(struct dsa_switch *ds)
 {
        struct dsa_switch_tree *dst = ds->dst;