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);
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;
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);
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);
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);
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)
* VFIO driver API
*/
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)
{
init_completion(&device->comp);
device->dev = dev;
device->ops = ops;
- device->device_data = device_data;
}
EXPORT_SYMBOL_GPL(vfio_init_group_dev);
return device;
}
-/*
- * Caller must hold a reference to the vfio_device
- */
-void *vfio_device_data(struct vfio_device *device)
-{
- return device->device_data;
-}
-EXPORT_SYMBOL_GPL(vfio_device_data);
-
/*
* Decrement the device reference count and wait for the device to be
* removed. Open file descriptors for the device... */
refcount_t refcount;
struct completion comp;
struct list_head group_next;
- void *device_data;
};
/**
extern void vfio_iommu_group_put(struct iommu_group *group, struct device *dev);
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);
extern struct vfio_device *vfio_device_get_from_dev(struct device *dev);
extern void vfio_device_put(struct vfio_device *device);
-extern void *vfio_device_data(struct vfio_device *device);
/* events for the backend driver notify callback */
enum vfio_iommu_notify_type {