Commit 1e04ec14 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Alex Williamson
Browse files

vfio: Remove device_data from the vfio bus driver API



There are no longer any users, so it can go away. Everything is using
container_of now.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Message-Id: <14-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 07d47b42
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -254,8 +254,7 @@ vfio_unregister_group_dev() respectively::

	void vfio_init_group_dev(struct vfio_device *device,
				struct device *dev,
				const struct vfio_device_ops *ops,
				void *device_data);
				const struct vfio_device_ops *ops);
	int vfio_register_group_dev(struct vfio_device *device);
	void vfio_unregister_group_dev(struct vfio_device *device);

+3 −2
Original line number Diff line number Diff line
@@ -75,7 +75,8 @@ static int vfio_fsl_mc_reflck_attach(struct vfio_fsl_mc_device *vdev)
			goto unlock;
		}

		cont_vdev = vfio_device_data(device);
		cont_vdev =
			container_of(device, struct vfio_fsl_mc_device, vdev);
		if (!cont_vdev || !cont_vdev->reflck) {
			vfio_device_put(device);
			ret = -ENODEV;
@@ -630,7 +631,7 @@ static int vfio_fsl_mc_probe(struct fsl_mc_device *mc_dev)
		goto out_group_put;
	}

	vfio_init_group_dev(&vdev->vdev, dev, &vfio_fsl_mc_ops, vdev);
	vfio_init_group_dev(&vdev->vdev, dev, &vfio_fsl_mc_ops);
	vdev->mc_dev = mc_dev;
	mutex_init(&vdev->igate);

+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static int vfio_mdev_probe(struct device *dev)
	if (!vdev)
		return -ENOMEM;

	vfio_init_group_dev(vdev, &mdev->dev, &vfio_mdev_dev_ops, mdev);
	vfio_init_group_dev(vdev, &mdev->dev, &vfio_mdev_dev_ops);
	ret = vfio_register_group_dev(vdev);
	if (ret) {
		kfree(vdev);
+1 −1
Original line number Diff line number Diff line
@@ -2022,7 +2022,7 @@ static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
		goto out_group_put;
	}

	vfio_init_group_dev(&vdev->vdev, &pdev->dev, &vfio_pci_ops, vdev);
	vfio_init_group_dev(&vdev->vdev, &pdev->dev, &vfio_pci_ops);
	vdev->pdev = pdev;
	vdev->irq_type = VFIO_PCI_NUM_IRQS;
	mutex_init(&vdev->igate);
+1 −1
Original line number Diff line number Diff line
@@ -666,7 +666,7 @@ int vfio_platform_probe_common(struct vfio_platform_device *vdev,
	struct iommu_group *group;
	int ret;

	vfio_init_group_dev(&vdev->vdev, dev, &vfio_platform_ops, vdev);
	vfio_init_group_dev(&vdev->vdev, dev, &vfio_platform_ops);

	ret = vfio_platform_acpi_probe(vdev, dev);
	if (ret)
Loading