summaryrefslogtreecommitdiff
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.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/samples/vfio-mdev/mbochs.c b/samples/vfio-mdev/mbochs.c
index a2fc13fade75..0b7585f16d8a 100644
--- a/samples/vfio-mdev/mbochs.c
+++ b/samples/vfio-mdev/mbochs.c
@@ -101,26 +101,25 @@ MODULE_PARM_DESC(mem, "megabytes available to " MBOCHS_NAME " devices");
static struct mbochs_type {
struct mdev_type type;
- const char *name;
u32 mbytes;
u32 max_x;
u32 max_y;
} mbochs_types[] = {
{
.type.sysfs_name = MBOCHS_TYPE_1,
- .name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_1,
+ .type.pretty_name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_1,
.mbytes = 4,
.max_x = 800,
.max_y = 600,
}, {
.type.sysfs_name = MBOCHS_TYPE_2,
- .name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_2,
+ .type.pretty_name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_2,
.mbytes = 16,
.max_x = 1920,
.max_y = 1440,
}, {
.type.sysfs_name = MBOCHS_TYPE_3,
- .name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_3,
+ .type.pretty_name = MBOCHS_CLASS_NAME "-" MBOCHS_TYPE_3,
.mbytes = 64,
.max_x = 0,
.max_y = 0,
@@ -556,7 +555,7 @@ static int mbochs_init_dev(struct vfio_device *vdev)
mbochs_reset(mdev_state);
dev_info(vdev->dev, "%s: %s, %d MB, %ld pages\n", __func__,
- type->name, type->mbytes, mdev_state->pagecount);
+ type->type.pretty_name, type->mbytes, mdev_state->pagecount);
return 0;
err_vconfig:
@@ -1351,16 +1350,6 @@ static const struct attribute_group *mdev_dev_groups[] = {
NULL,
};
-static ssize_t name_show(struct mdev_type *mtype,
- struct mdev_type_attribute *attr, char *buf)
-{
- struct mbochs_type *type =
- container_of(mtype, struct mbochs_type, type);
-
- return sprintf(buf, "%s\n", type->name);
-}
-static MDEV_TYPE_ATTR_RO(name);
-
static ssize_t description_show(struct mdev_type *mtype,
struct mdev_type_attribute *attr, char *buf)
{
@@ -1385,7 +1374,6 @@ static ssize_t available_instances_show(struct mdev_type *mtype,
static MDEV_TYPE_ATTR_RO(available_instances);
static const struct attribute *mdev_types_attrs[] = {
- &mdev_type_attr_name.attr,
&mdev_type_attr_description.attr,
&mdev_type_attr_available_instances.attr,
NULL,