mlxsw: spectrum: Set physical device for port netdevice
authorJiri Pirko <jiri@mellanox.com>
Thu, 27 Oct 2016 13:13:00 +0000 (15:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Oct 2016 17:45:52 +0000 (13:45 -0400)
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>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 780524065889f677c51e7cd9f78f2118b5fa72ad..d652f7f030cbc56cd857bc72438a8de973f714e8 100644 (file)
@@ -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));
        if (!dev)
                return -ENOMEM;
+       SET_NETDEV_DEV(dev, mlxsw_sp->bus_info->dev);
        mlxsw_sp_port = netdev_priv(dev);
        mlxsw_sp_port->dev = dev;
        mlxsw_sp_port->mlxsw_sp = mlxsw_sp;