summaryrefslogtreecommitdiff
path: root/drivers/vfio/vfio_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vfio/vfio_main.c')
-rw-r--r--drivers/vfio/vfio_main.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c
index b9c6a97d647a..12952858d903 100644
--- a/drivers/vfio/vfio_main.c
+++ b/drivers/vfio/vfio_main.c
@@ -483,28 +483,13 @@ static struct vfio_device *vfio_group_get_device(struct vfio_group *group,
/*
* VFIO driver API
*/
-void vfio_init_group_dev(struct vfio_device *device, struct device *dev,
- const struct vfio_device_ops *ops)
-{
- init_completion(&device->comp);
- device->dev = dev;
- device->ops = ops;
-}
-EXPORT_SYMBOL_GPL(vfio_init_group_dev);
-
-void vfio_uninit_group_dev(struct vfio_device *device)
-{
- vfio_release_device_set(device);
-}
-EXPORT_SYMBOL_GPL(vfio_uninit_group_dev);
-
/* Release helper called by vfio_put_device() */
void vfio_device_release(struct kref *kref)
{
struct vfio_device *device =
container_of(kref, struct vfio_device, kref);
- vfio_uninit_group_dev(device);
+ vfio_release_device_set(device);
/*
* kvfree() cannot be done here due to a life cycle mess in
@@ -562,7 +547,9 @@ int vfio_init_device(struct vfio_device *device, struct device *dev,
{
int ret;
- vfio_init_group_dev(device, dev, ops);
+ init_completion(&device->comp);
+ device->dev = dev;
+ device->ops = ops;
if (ops->init) {
ret = ops->init(device);
@@ -574,7 +561,7 @@ int vfio_init_device(struct vfio_device *device, struct device *dev,
return 0;
out_uninit:
- vfio_uninit_group_dev(device);
+ vfio_release_device_set(device);
return ret;
}
EXPORT_SYMBOL_GPL(vfio_init_device);