Skip to content

Commit

Permalink
RDMA/irdma: Use auxiliary_device driver data helpers
Browse files Browse the repository at this point in the history
Use auxiliary_get_drvdata and auxiliary_set_drvdata helpers.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20211221235852.323752-2-david.e.box@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
David E. Box authored and Greg Kroah-Hartman committed Dec 22, 2021
1 parent a3c8f90 commit 27963d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/irdma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void irdma_remove(struct auxiliary_device *aux_dev)
struct iidc_auxiliary_dev,
adev);
struct ice_pf *pf = iidc_adev->pf;
struct irdma_device *iwdev = dev_get_drvdata(&aux_dev->dev);
struct irdma_device *iwdev = auxiliary_get_drvdata(aux_dev);

irdma_ib_unregister_device(iwdev);
ice_rdma_update_vsi_filter(pf, iwdev->vsi_num, false);
Expand Down Expand Up @@ -294,7 +294,7 @@ static int irdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary_
ice_rdma_update_vsi_filter(pf, iwdev->vsi_num, true);

ibdev_dbg(&iwdev->ibdev, "INIT: Gen2 PF[%d] device probe success\n", PCI_FUNC(rf->pcidev->devfn));
dev_set_drvdata(&aux_dev->dev, iwdev);
auxiliary_set_drvdata(aux_dev, iwdev);

return 0;

Expand Down
8 changes: 4 additions & 4 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4422,15 +4422,15 @@ static int mlx5r_mp_probe(struct auxiliary_device *adev,
}
mutex_unlock(&mlx5_ib_multiport_mutex);

dev_set_drvdata(&adev->dev, mpi);
auxiliary_set_drvdata(adev, mpi);
return 0;
}

static void mlx5r_mp_remove(struct auxiliary_device *adev)
{
struct mlx5_ib_multiport_info *mpi;

mpi = dev_get_drvdata(&adev->dev);
mpi = auxiliary_get_drvdata(adev);
mutex_lock(&mlx5_ib_multiport_mutex);
if (mpi->ibdev)
mlx5_ib_unbind_slave_port(mpi->ibdev, mpi);
Expand Down Expand Up @@ -4480,15 +4480,15 @@ static int mlx5r_probe(struct auxiliary_device *adev,
return ret;
}

dev_set_drvdata(&adev->dev, dev);
auxiliary_set_drvdata(adev, dev);
return 0;
}

static void mlx5r_remove(struct auxiliary_device *adev)
{
struct mlx5_ib_dev *dev;

dev = dev_get_drvdata(&adev->dev);
dev = auxiliary_get_drvdata(adev);
__mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX);
}

Expand Down

0 comments on commit 27963d3

Please sign in to comment.