Commit 913447d0 authored by Eric Farman's avatar Eric Farman Committed by Alex Williamson
Browse files

vfio: Remove vfio_free_device



With the "mess" sorted out, we should be able to inline the
vfio_free_device call introduced by commit cb9ff3f3
("vfio: Add helpers for unifying vfio_device life cycle")
and remove them from driver release callbacks.

Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>	# vfio-ap part
Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20221104142007.1314999-8-farman@linux.ibm.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent d1104f93
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1461,7 +1461,6 @@ static void intel_vgpu_release_dev(struct vfio_device *vfio_dev)
	struct intel_vgpu *vgpu = vfio_dev_to_vgpu(vfio_dev);

	intel_gvt_destroy_vgpu(vgpu);
	vfio_free_device(vfio_dev);
}

static const struct vfio_device_ops intel_vgpu_dev_ops = {
+0 −2
Original line number Diff line number Diff line
@@ -143,8 +143,6 @@ static void vfio_ccw_mdev_release_dev(struct vfio_device *vdev)
	kmem_cache_free(vfio_ccw_io_region, private->io_region);
	kfree(private->cp.guest_cp);
	mutex_destroy(&private->io_mutex);

	vfio_free_device(vdev);
}

static void vfio_ccw_mdev_remove(struct mdev_device *mdev)
+0 −6
Original line number Diff line number Diff line
@@ -765,11 +765,6 @@ static void vfio_ap_mdev_unlink_fr_queues(struct ap_matrix_mdev *matrix_mdev)
	}
}

static void vfio_ap_mdev_release_dev(struct vfio_device *vdev)
{
	vfio_free_device(vdev);
}

static void vfio_ap_mdev_remove(struct mdev_device *mdev)
{
	struct ap_matrix_mdev *matrix_mdev = dev_get_drvdata(&mdev->dev);
@@ -1784,7 +1779,6 @@ static const struct attribute_group vfio_queue_attr_group = {

static const struct vfio_device_ops vfio_ap_matrix_dev_ops = {
	.init = vfio_ap_mdev_init_dev,
	.release = vfio_ap_mdev_release_dev,
	.open_device = vfio_ap_mdev_open_device,
	.close_device = vfio_ap_mdev_close_device,
	.ioctl = vfio_ap_mdev_ioctl,
+0 −1
Original line number Diff line number Diff line
@@ -568,7 +568,6 @@ static void vfio_fsl_mc_release_dev(struct vfio_device *core_vdev)

	vfio_fsl_uninit_device(vdev);
	mutex_destroy(&vdev->igate);
	vfio_free_device(core_vdev);
}

static int vfio_fsl_mc_remove(struct fsl_mc_device *mc_dev)
+0 −1
Original line number Diff line number Diff line
@@ -2109,7 +2109,6 @@ void vfio_pci_core_release_dev(struct vfio_device *core_vdev)
	mutex_destroy(&vdev->vma_lock);
	kfree(vdev->region);
	kfree(vdev->pm_save);
	vfio_free_device(core_vdev);
}
EXPORT_SYMBOL_GPL(vfio_pci_core_release_dev);

Loading