浏览代码

mlxsw: spectrum: Set physical device for port netdevice

Do this so the sysfs has "device" link correctly set.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Pirko 8 年之前
父节点
当前提交
f20a91f1cc
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/net/ethernet/mellanox/mlxsw/spectrum.c

+ 1 - 0
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

@@ -2222,6 +2222,7 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port,
 	dev = alloc_etherdev(sizeof(struct mlxsw_sp_port));
 	dev = alloc_etherdev(sizeof(struct mlxsw_sp_port));
 	if (!dev)
 	if (!dev)
 		return -ENOMEM;
 		return -ENOMEM;
+	SET_NETDEV_DEV(dev, mlxsw_sp->bus_info->dev);
 	mlxsw_sp_port = netdev_priv(dev);
 	mlxsw_sp_port = netdev_priv(dev);
 	mlxsw_sp_port->dev = dev;
 	mlxsw_sp_port->dev = dev;
 	mlxsw_sp_port->mlxsw_sp = mlxsw_sp;
 	mlxsw_sp_port->mlxsw_sp = mlxsw_sp;