Commit 6c75258c authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net/mlx5e: Set en auxiliary devlink instance as nested

Benefit from the previous commit introducing exposure of devlink
instances relationship and set the nested instance for en auxiliary
device.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5e1bf8a
......@@ -12,11 +12,19 @@ struct mlx5e_dev *mlx5e_create_devlink(struct device *dev,
{
struct mlx5e_dev *mlx5e_dev;
struct devlink *devlink;
int err;
devlink = devlink_alloc_ns(&mlx5e_devlink_ops, sizeof(*mlx5e_dev),
devlink_net(priv_to_devlink(mdev)), dev);
if (!devlink)
return ERR_PTR(-ENOMEM);
err = devl_nested_devlink_set(priv_to_devlink(mdev), devlink);
if (err) {
devlink_free(devlink);
return ERR_PTR(err);
}
devlink_register(devlink);
return devlink_priv(devlink);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment