RE: [PATCH v3 13/15] vfio: Add cdev for vfio_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Liu, Yi L <yi.l.liu@xxxxxxxxx>
> Sent: Monday, February 13, 2023 11:14 PM
> 
> +/*
> + * cdev open op. device access via the fd opened by this function
> + * is blocked until .open_device() is called successfully during
> + * BIND_IOMMUFD.
> + */

remove "cdev open op"

> +int vfio_device_fops_open(struct inode *inode, struct file *filep)

vfio_device_fops_cdev_open()

> 
> +static int vfio_device_add(struct vfio_device *device)
> +{
> +	int ret;
> +
> +	if (IS_ENABLED(CONFIG_VFIO_DEVICE_CDEV))
> +		ret = cdev_device_add(&device->cdev, &device->device);
> +	else
> +		ret = device_add(&device->device);
> +	return ret;
> +}
> +
> +static void vfio_device_del(struct vfio_device *device)
> +{
> +	if (IS_ENABLED(CONFIG_VFIO_DEVICE_CDEV))
> +		cdev_device_del(&device->cdev, &device->device);
> +	else
> +		device_del(&device->device);
> +}
> +

move to header file and have CONFIG_VFIO_DEVICE_CDEV
wrapping vfio_device_add/del() directly.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux