> From: Liu, Yi L <[email protected]>
> 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.

Reply via email to