mlxsw: switchx2: Set physical device for port netdevice
authorJiri Pirko <jiri@mellanox.com>
Thu, 27 Oct 2016 13:13:01 +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/switchx2.c

index 938e22d14e111e750c70e5c3f289594ccba97376..dc3c5ed73ecd5b2697a4c2068c485520aa913642 100644 (file)
@@ -968,6 +968,7 @@ static int mlxsw_sx_port_create(struct mlxsw_sx *mlxsw_sx, u8 local_port)
        dev = alloc_etherdev(sizeof(struct mlxsw_sx_port));
        if (!dev)
                return -ENOMEM;
+       SET_NETDEV_DEV(dev, mlxsw_sx->bus_info->dev);
        mlxsw_sx_port = netdev_priv(dev);
        mlxsw_sx_port->dev = dev;
        mlxsw_sx_port->mlxsw_sx = mlxsw_sx;