summaryrefslogtreecommitdiff
path: root/samples/vfio-mdev/mdpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/vfio-mdev/mdpy.c')
-rw-r--r--samples/vfio-mdev/mdpy.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/samples/vfio-mdev/mdpy.c b/samples/vfio-mdev/mdpy.c
index 90c6fed200b1..d1c835c9cabf 100644
--- a/samples/vfio-mdev/mdpy.c
+++ b/samples/vfio-mdev/mdpy.c
@@ -671,17 +671,13 @@ static ssize_t description_show(struct mdev_type *mtype,
}
static MDEV_TYPE_ATTR_RO(description);
-static ssize_t available_instances_show(struct mdev_type *mtype,
- struct mdev_type_attribute *attr,
- char *buf)
+static unsigned int mdpy_get_available(struct mdev_type *mtype)
{
- return sprintf(buf, "%d\n", max_devices - mdpy_count);
+ return max_devices - mdpy_count;
}
-static MDEV_TYPE_ATTR_RO(available_instances);
static const struct attribute *mdev_types_attrs[] = {
&mdev_type_attr_description.attr,
- &mdev_type_attr_available_instances.attr,
NULL,
};
@@ -704,6 +700,7 @@ static struct mdev_driver mdpy_driver = {
},
.probe = mdpy_probe,
.remove = mdpy_remove,
+ .get_available = mdpy_get_available,
.types_attrs = mdev_types_attrs,
};