summaryrefslogtreecommitdiff
path: root/samples/vfio-mdev/mtty.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/vfio-mdev/mtty.c')
-rw-r--r--samples/vfio-mdev/mtty.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
index 064e71b28dd1..eab1b4442a96 100644
--- a/samples/vfio-mdev/mtty.c
+++ b/samples/vfio-mdev/mtty.c
@@ -146,10 +146,11 @@ struct mdev_state {
static struct mtty_type {
struct mdev_type type;
int nr_ports;
- const char *name;
} mtty_types[2] = {
- { .nr_ports = 1, .type.sysfs_name = "1", .name = "Single port serial" },
- { .nr_ports = 2, .type.sysfs_name = "2", .name = "Dual port serial" },
+ { .nr_ports = 1, .type.sysfs_name = "1",
+ .type.pretty_name = "Single port serial" },
+ { .nr_ports = 2, .type.sysfs_name = "2",
+ .type.pretty_name = "Dual port serial" },
};
static struct mdev_type *mtty_mdev_types[] = {
@@ -1255,16 +1256,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 mtty_type *type = container_of(mtype, struct mtty_type, type);
-
- return sysfs_emit(buf, "%s\n", type->name);
-}
-
-static MDEV_TYPE_ATTR_RO(name);
-
static ssize_t available_instances_show(struct mdev_type *mtype,
struct mdev_type_attribute *attr,
char *buf)
@@ -1278,7 +1269,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_available_instances.attr,
NULL,
};