diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-03 15:24:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-05 03:42:36 +0300 |
commit | 15b04aceeb83086ea3109c331cb7d8c2767fa0c6 (patch) | |
tree | cf87b7b657cdd87f7c6ba1986aa3751560024366 /net/dsa/dsa2.c | |
parent | df535f4c47a60fd6bf8f1327e9f87628e581e136 (diff) | |
download | linux-15b04aceeb83086ea3109c331cb7d8c2767fa0c6.tar.xz |
dsa: pass switch ID through devlink_port_attrs_set()
Pass the switch ID down the to devlink through devlink_port_attrs_set()
so it can be used by devlink_compat_switch_id_get(). Leave
ndo_get_port_parent_id implementation only for legacy.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r-- | net/dsa/dsa2.c | 4 |
1 files changed, 3 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) { enum devlink_port_flavour flavour; struct dsa_switch *ds = dp->ds; + struct dsa_switch_tree *dst = ds->dst; int err; if (dp->type == DSA_PORT_TYPE_UNUSED) @@ -286,7 +287,8 @@ static int dsa_port_setup(struct dsa_port *dp) * independent from front panel port numbers. */ devlink_port_attrs_set(&dp->devlink_port, flavour, - dp->index, false, 0, NULL, 0); + dp->index, false, 0, + (const char *) &dst->index, sizeof(dst->index)); err = devlink_port_register(ds->devlink, &dp->devlink_port, dp->index); if (err) |