Skip to content

Commit

Permalink
net/mlx5e: Add wrapping for auxiliary_driver ops and remove unused args
Browse files Browse the repository at this point in the history
Turn some of the struct auxiliary_driver ops into wrappers to stop
having dummy local vars passed as unused arguments.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Tariq Toukan authored and Saeed Mahameed committed Dec 14, 2023
1 parent c909eec commit b1a33e6
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5984,7 +5984,7 @@ static int mlx5e_resume(struct auxiliary_device *adev)
return 0;
}

static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
static int _mlx5e_suspend(struct auxiliary_device *adev)
{
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv;
Expand All @@ -6002,15 +6002,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
return 0;
}

static int mlx5e_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
{
return _mlx5e_suspend(adev);
}

static int _mlx5e_probe(struct auxiliary_device *adev)
{
struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev);
const struct mlx5e_profile *profile = &mlx5e_nic_profile;
struct mlx5_core_dev *mdev = edev->mdev;
struct mlx5e_dev *mlx5e_dev;
struct net_device *netdev;
pm_message_t state = {};
struct mlx5e_priv *priv;
int err;

Expand Down Expand Up @@ -6065,7 +6068,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return 0;

err_resume:
mlx5e_suspend(adev, state);
_mlx5e_suspend(adev);
err_profile_cleanup:
profile->cleanup(priv);
err_destroy_netdev:
Expand All @@ -6077,16 +6080,21 @@ static int mlx5e_probe(struct auxiliary_device *adev,
return err;
}

static int mlx5e_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{
return _mlx5e_probe(adev);
}

static void mlx5e_remove(struct auxiliary_device *adev)
{
struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
struct mlx5e_priv *priv = mlx5e_dev->priv;
pm_message_t state = {};

mlx5_core_uplink_netdev_set(priv->mdev, NULL);
mlx5e_dcbnl_delete_app(priv);
unregister_netdev(priv->netdev);
mlx5e_suspend(adev, state);
_mlx5e_suspend(adev);
priv->profile->cleanup(priv);
mlx5e_destroy_netdev(priv);
mlx5e_devlink_port_unregister(mlx5e_dev);
Expand Down

0 comments on commit b1a33e6

Please sign in to comment.