diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-03-28 08:56:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-28 15:55:31 -0400 |
commit | d484210bf745ee6d8269b7d747bc5b94c4416ff1 (patch) | |
tree | b9f3adc7268f2cc4db56bf583510628fa59f544a /net/dsa | |
parent | 716efee200a7fcf4d1eedf9f6e71751d4ed8e806 (diff) |
dsa: do not support ndo_get_phys_port_name for non-legacy ports
Since each non-legacy slave has its own devlink port instance
correctly set, rely on devlink core to generate correct phys port name.
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')
-rw-r--r-- | net/dsa/slave.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d1a0a656b6b5..80be8e86c82d 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -736,6 +736,13 @@ static int dsa_slave_get_phys_port_name(struct net_device *dev, | |||
736 | { | 736 | { |
737 | struct dsa_port *dp = dsa_slave_to_port(dev); | 737 | struct dsa_port *dp = dsa_slave_to_port(dev); |
738 | 738 | ||
739 | /* For non-legacy ports, devlink is used and it takes | ||
740 | * care of the name generation. This ndo implementation | ||
741 | * should be removed with legacy support. | ||
742 | */ | ||
743 | if (dp->ds->devlink) | ||
744 | return -EOPNOTSUPP; | ||
745 | |||
739 | if (snprintf(name, len, "p%d", dp->index) >= len) | 746 | if (snprintf(name, len, "p%d", dp->index) >= len) |
740 | return -EINVAL; | 747 | return -EINVAL; |
741 | 748 | ||