summaryrefslogtreecommitdiff
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index b80dbd02e154..f8df55e2e23a 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -855,6 +855,14 @@ disconnect:
return err;
}
+static void dsa_switch_teardown_tag_protocol(struct dsa_switch *ds)
+{
+ const struct dsa_device_ops *tag_ops = ds->dst->tag_ops;
+
+ if (tag_ops->disconnect)
+ tag_ops->disconnect(ds);
+}
+
static int dsa_switch_setup(struct dsa_switch *ds)
{
struct dsa_devlink_priv *dl_priv;
@@ -944,6 +952,8 @@ static void dsa_switch_teardown(struct dsa_switch *ds)
ds->slave_mii_bus = NULL;
}
+ dsa_switch_teardown_tag_protocol(ds);
+
if (ds->ops->teardown)
ds->ops->teardown(ds);
@@ -1355,9 +1365,6 @@ static struct dsa_port *dsa_port_touch(struct dsa_switch *ds, int index)
static int dsa_port_parse_user(struct dsa_port *dp, const char *name)
{
- if (!name)
- name = "eth%d";
-
dp->type = DSA_PORT_TYPE_USER;
dp->name = name;
@@ -1424,7 +1431,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *master,
return -EINVAL;
}
- tag_ops = dsa_find_tagger_by_name(user_protocol);
+ tag_ops = dsa_tag_driver_get_by_name(user_protocol);
if (IS_ERR(tag_ops)) {
dev_warn(ds->dev,
"Failed to find a tagging driver for protocol %s, using default\n",
@@ -1434,7 +1441,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *master,
}
if (!tag_ops)
- tag_ops = dsa_tag_driver_get(default_proto);
+ tag_ops = dsa_tag_driver_get_by_id(default_proto);
if (IS_ERR(tag_ops)) {
if (PTR_ERR(tag_ops) == -ENOPROTOOPT)