Skip to content

Commit d484210

Browse files
jpirkodavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 716efee commit d484210

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/dsa/slave.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,13 @@ static int dsa_slave_get_phys_port_name(struct net_device *dev,
736736
{
737737
struct dsa_port *dp = dsa_slave_to_port(dev);
738738

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+
739746
if (snprintf(name, len, "p%d", dp->index) >= len)
740747
return -EINVAL;
741748

0 commit comments

Comments
 (0)