Skip to content

Commit 17a1e4f

Browse files
jgunthorpeAlex Williamson
authored andcommitted
vfio/samples: Delete useless open/close
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>
1 parent 2fd585f commit 17a1e4f

3 files changed

Lines changed: 0 additions & 30 deletions

File tree

samples/vfio-mdev/mbochs.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,11 +1278,6 @@ static long mbochs_ioctl(struct vfio_device *vdev, unsigned int cmd,
12781278
return -ENOTTY;
12791279
}
12801280

1281-
static int mbochs_open(struct vfio_device *vdev)
1282-
{
1283-
return 0;
1284-
}
1285-
12861281
static void mbochs_close(struct vfio_device *vdev)
12871282
{
12881283
struct mdev_state *mdev_state =
@@ -1401,7 +1396,6 @@ static struct attribute_group *mdev_type_groups[] = {
14011396
};
14021397

14031398
static const struct vfio_device_ops mbochs_dev_ops = {
1404-
.open = mbochs_open,
14051399
.release = mbochs_close,
14061400
.read = mbochs_read,
14071401
.write = mbochs_write,

samples/vfio-mdev/mdpy.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,6 @@ static long mdpy_ioctl(struct vfio_device *vdev, unsigned int cmd,
614614
return -ENOTTY;
615615
}
616616

617-
static int mdpy_open(struct vfio_device *vdev)
618-
{
619-
return 0;
620-
}
621-
622-
static void mdpy_close(struct vfio_device *vdev)
623-
{
624-
}
625-
626617
static ssize_t
627618
resolution_show(struct device *dev, struct device_attribute *attr,
628619
char *buf)
@@ -717,8 +708,6 @@ static struct attribute_group *mdev_type_groups[] = {
717708
};
718709

719710
static const struct vfio_device_ops mdpy_dev_ops = {
720-
.open = mdpy_open,
721-
.release = mdpy_close,
722711
.read = mdpy_read,
723712
.write = mdpy_write,
724713
.ioctl = mdpy_ioctl,

samples/vfio-mdev/mtty.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,17 +1207,6 @@ static long mtty_ioctl(struct vfio_device *vdev, unsigned int cmd,
12071207
return -ENOTTY;
12081208
}
12091209

1210-
static int mtty_open(struct vfio_device *vdev)
1211-
{
1212-
pr_info("%s\n", __func__);
1213-
return 0;
1214-
}
1215-
1216-
static void mtty_close(struct vfio_device *mdev)
1217-
{
1218-
pr_info("%s\n", __func__);
1219-
}
1220-
12211210
static ssize_t
12221211
sample_mtty_dev_show(struct device *dev, struct device_attribute *attr,
12231212
char *buf)
@@ -1325,8 +1314,6 @@ static struct attribute_group *mdev_type_groups[] = {
13251314

13261315
static const struct vfio_device_ops mtty_dev_ops = {
13271316
.name = "vfio-mtty",
1328-
.open = mtty_open,
1329-
.release = mtty_close,
13301317
.read = mtty_read,
13311318
.write = mtty_write,
13321319
.ioctl = mtty_ioctl,

0 commit comments

Comments
 (0)