Lines Matching refs:vdev
19 struct vdpa_device *vdev = dev_to_vdpa(d); in vdpa_dev_probe() local
20 struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); in vdpa_dev_probe()
24 ret = drv->probe(vdev); in vdpa_dev_probe()
31 struct vdpa_device *vdev = dev_to_vdpa(d); in vdpa_dev_remove() local
32 struct vdpa_driver *drv = drv_to_vdpa(vdev->dev.driver); in vdpa_dev_remove()
35 drv->remove(vdev); in vdpa_dev_remove()
48 struct vdpa_device *vdev = dev_to_vdpa(d); in vdpa_release_dev() local
49 const struct vdpa_config_ops *ops = vdev->config; in vdpa_release_dev()
52 ops->free(vdev); in vdpa_release_dev()
54 ida_simple_remove(&vdpa_index_ida, vdev->index); in vdpa_release_dev()
55 kfree(vdev); in vdpa_release_dev()
78 struct vdpa_device *vdev; in __vdpa_alloc_device() local
88 vdev = kzalloc(size, GFP_KERNEL); in __vdpa_alloc_device()
89 if (!vdev) in __vdpa_alloc_device()
96 vdev->dev.bus = &vdpa_bus; in __vdpa_alloc_device()
97 vdev->dev.parent = parent; in __vdpa_alloc_device()
98 vdev->dev.release = vdpa_release_dev; in __vdpa_alloc_device()
99 vdev->index = err; in __vdpa_alloc_device()
100 vdev->config = config; in __vdpa_alloc_device()
101 vdev->features_valid = false; in __vdpa_alloc_device()
102 vdev->nvqs = nvqs; in __vdpa_alloc_device()
104 err = dev_set_name(&vdev->dev, "vdpa%u", vdev->index); in __vdpa_alloc_device()
108 device_initialize(&vdev->dev); in __vdpa_alloc_device()
110 return vdev; in __vdpa_alloc_device()
113 ida_simple_remove(&vdpa_index_ida, vdev->index); in __vdpa_alloc_device()
115 kfree(vdev); in __vdpa_alloc_device()
128 int vdpa_register_device(struct vdpa_device *vdev) in vdpa_register_device() argument
130 return device_add(&vdev->dev); in vdpa_register_device()
138 void vdpa_unregister_device(struct vdpa_device *vdev) in vdpa_unregister_device() argument
140 device_unregister(&vdev->dev); in vdpa_unregister_device()