diff options
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa2.c | 4 | ||||
-rw-r--r-- | net/dsa/slave.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index 4493b2ff3438..d122f1bcdab2 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c | |||
@@ -260,6 +260,7 @@ static int dsa_port_setup(struct dsa_port *dp) | |||
260 | { | 260 | { |
261 | enum devlink_port_flavour flavour; | 261 | enum devlink_port_flavour flavour; |
262 | struct dsa_switch *ds = dp->ds; | 262 | struct dsa_switch *ds = dp->ds; |
263 | struct dsa_switch_tree *dst = ds->dst; | ||
263 | int err; | 264 | int err; |
264 | 265 | ||
265 | if (dp->type == DSA_PORT_TYPE_UNUSED) | 266 | if (dp->type == DSA_PORT_TYPE_UNUSED) |
@@ -286,7 +287,8 @@ static int dsa_port_setup(struct dsa_port *dp) | |||
286 | * independent from front panel port numbers. | 287 | * independent from front panel port numbers. |
287 | */ | 288 | */ |
288 | devlink_port_attrs_set(&dp->devlink_port, flavour, | 289 | devlink_port_attrs_set(&dp->devlink_port, flavour, |
289 | dp->index, false, 0, NULL, 0); | 290 | dp->index, false, 0, |
291 | (const char *) &dst->index, sizeof(dst->index)); | ||
290 | err = devlink_port_register(ds->devlink, &dp->devlink_port, | 292 | err = devlink_port_register(ds->devlink, &dp->devlink_port, |
291 | dp->index); | 293 | dp->index); |
292 | if (err) | 294 | if (err) |
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index f83525909c57..ce26dddc8270 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -379,6 +379,13 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev, | |||
379 | struct dsa_switch *ds = dp->ds; | 379 | struct dsa_switch *ds = dp->ds; |
380 | struct dsa_switch_tree *dst = ds->dst; | 380 | struct dsa_switch_tree *dst = ds->dst; |
381 | 381 | ||
382 | /* For non-legacy ports, devlink is used and it takes | ||
383 | * care of the name generation. This ndo implementation | ||
384 | * should be removed with legacy support. | ||
385 | */ | ||
386 | if (dp->ds->devlink) | ||
387 | return -EOPNOTSUPP; | ||
388 | |||
382 | ppid->id_len = sizeof(dst->index); | 389 | ppid->id_len = sizeof(dst->index); |
383 | memcpy(&ppid->id, &dst->index, ppid->id_len); | 390 | memcpy(&ppid->id, &dst->index, ppid->id_len); |
384 | 391 | ||