summaryrefslogtreecommitdiffstats
path: root/samples/vfio-mdev/mbochs.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/vfio-mdev/mbochs.c')
-rw-r--r--samples/vfio-mdev/mbochs.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
index 0b7585f16d8a..6c2cbc4e25ca 100644
--- a/samples/vfio-mdev/mbochs.c
+++ b/samples/vfio-mdev/mbochs.c
@@ -1361,21 +1361,16 @@ 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 mbochs_get_available(struct mdev_type *mtype)
{
struct mbochs_type *type =
container_of(mtype, struct mbochs_type, type);
- int count = atomic_read(&mbochs_avail_mbytes) / type->mbytes;
- return sprintf(buf, "%d\n", count);
+ return atomic_read(&mbochs_avail_mbytes) / type->mbytes;
}
-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,
};
@@ -1399,6 +1394,7 @@ static struct mdev_driver mbochs_driver = {
},
.probe = mbochs_probe,
.remove = mbochs_remove,
+ .get_available = mbochs_get_available,
.types_attrs = mdev_types_attrs,
};