Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d484210b authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

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: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 716efee2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -736,6 +736,13 @@ static int dsa_slave_get_phys_port_name(struct net_device *dev,
{
	struct dsa_port *dp = dsa_slave_to_port(dev);

	/* For non-legacy ports, devlink is used and it takes
	 * care of the name generation. This ndo implementation
	 * should be removed with legacy support.
	 */
	if (dp->ds->devlink)
		return -EOPNOTSUPP;

	if (snprintf(name, len, "p%d", dp->index) >= len)
		return -EINVAL;