vfio/samples: Delete useless open/close
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 6 Aug 2021 01:19:01 +0000 (22:19 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 11 Aug 2021 15:50:11 +0000 (09:50 -0600)
The core code no longer requires these ops to be defined, so delete these
empty functions and leave the op as NULL. mtty's functions only log a
pointless message, delete that entirely.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/5-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
samples/vfio-mdev/mbochs.c
samples/vfio-mdev/mdpy.c
samples/vfio-mdev/mtty.c

index 0f1511849b7c3c5a5b583026d9ac3972ba3ff1b2..7b2e12fe70827c76452ea68955709b00bc6b6790 100644 (file)
@@ -1278,11 +1278,6 @@ static long mbochs_ioctl(struct vfio_device *vdev, unsigned int cmd,
        return -ENOTTY;
 }
 
-static int mbochs_open(struct vfio_device *vdev)
-{
-       return 0;
-}
-
 static void mbochs_close(struct vfio_device *vdev)
 {
        struct mdev_state *mdev_state =
@@ -1401,7 +1396,6 @@ static struct attribute_group *mdev_type_groups[] = {
 };
 
 static const struct vfio_device_ops mbochs_dev_ops = {
-       .open = mbochs_open,
        .release = mbochs_close,
        .read = mbochs_read,
        .write = mbochs_write,
index 57334034cde6dd0faca6ef19af87033e82152900..8d1a80a0722aa9bc544e490e7b5949c863783ebb 100644 (file)
@@ -614,15 +614,6 @@ static long mdpy_ioctl(struct vfio_device *vdev, unsigned int cmd,
        return -ENOTTY;
 }
 
-static int mdpy_open(struct vfio_device *vdev)
-{
-       return 0;
-}
-
-static void mdpy_close(struct vfio_device *vdev)
-{
-}
-
 static ssize_t
 resolution_show(struct device *dev, struct device_attribute *attr,
                char *buf)
@@ -717,8 +708,6 @@ static struct attribute_group *mdev_type_groups[] = {
 };
 
 static const struct vfio_device_ops mdpy_dev_ops = {
-       .open = mdpy_open,
-       .release = mdpy_close,
        .read = mdpy_read,
        .write = mdpy_write,
        .ioctl = mdpy_ioctl,
index 37cc9067e1601df386481cd00ed317c1898e1f50..5983cdb16e3d1d6cc388325868fd9c2fa8a292e1 100644 (file)
@@ -1207,17 +1207,6 @@ static long mtty_ioctl(struct vfio_device *vdev, unsigned int cmd,
        return -ENOTTY;
 }
 
-static int mtty_open(struct vfio_device *vdev)
-{
-       pr_info("%s\n", __func__);
-       return 0;
-}
-
-static void mtty_close(struct vfio_device *mdev)
-{
-       pr_info("%s\n", __func__);
-}
-
 static ssize_t
 sample_mtty_dev_show(struct device *dev, struct device_attribute *attr,
                     char *buf)
@@ -1325,8 +1314,6 @@ static struct attribute_group *mdev_type_groups[] = {
 
 static const struct vfio_device_ops mtty_dev_ops = {
        .name = "vfio-mtty",
-       .open = mtty_open,
-       .release = mtty_close,
        .read = mtty_read,
        .write = mtty_write,
        .ioctl = mtty_ioctl,