From 097724c2fb203d1bfa0853ddf73c3a5df030ab05 Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Fri, 26 Sep 2014 20:49:50 -0500 Subject: [PATCH] greybus: remove unused function descriptor fields and change class->function_type Greybus spec was updated to remove a number of unused function descriptor fields. In addition, the class field was change to function_type to avoid confusion with the concept of high-level class drivers. Signed-off-by: Matt Porter Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus_manifest.h | 8 ++------ drivers/staging/greybus/sysfs.c | 17 ++++------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/staging/greybus/greybus_manifest.h b/drivers/staging/greybus/greybus_manifest.h index 6dda11cef5ef..2830d552f0e1 100644 --- a/drivers/staging/greybus/greybus_manifest.h +++ b/drivers/staging/greybus/greybus_manifest.h @@ -31,7 +31,7 @@ struct greybus_descriptor_header { __le16 type; /* enum greybus_descriptor_type */ }; -enum greybus_function_class { +enum greybus_function_type { GREYBUS_FUNCTION_CONTROL = 0x00, GREYBUS_FUNCTION_USB = 0x01, GREYBUS_FUNCTION_GPIO = 0x02, @@ -49,12 +49,8 @@ enum greybus_function_class { }; struct greybus_descriptor_function { - __le16 number; __le16 cport; - __u8 class; /* enum greybus_function_class */ - __u8 subclass; - __u8 protocol; - __u8 reserved; + __u8 function_type; /* enum greybus_function_type */ }; struct greybus_descriptor_module { diff --git a/drivers/staging/greybus/sysfs.c b/drivers/staging/greybus/sysfs.c index 55dc7b786ac8..1f17388445ad 100644 --- a/drivers/staging/greybus/sysfs.c +++ b/drivers/staging/greybus/sysfs.c @@ -31,18 +31,12 @@ static ssize_t function_##field##_show(struct device *dev, \ } \ static DEVICE_ATTR_RO(function_##field) -greybus_function_attr(number); greybus_function_attr(cport); -greybus_function_attr(class); -greybus_function_attr(subclass); -greybus_function_attr(protocol); +greybus_function_attr(function_type); static struct attribute *function_attrs[] = { - &dev_attr_function_number.attr, &dev_attr_function_cport.attr, - &dev_attr_function_class.attr, - &dev_attr_function_subclass.attr, - &dev_attr_function_protocol.attr, + &dev_attr_function_function_type.attr, NULL, }; @@ -53,11 +47,8 @@ static umode_t function_attrs_are_visible(struct kobject *kobj, // FIXME - make this a dynamic structure to "know" if it really is here // or not easier? - if (gmod->function.number || - gmod->function.cport || - gmod->function.class || - gmod->function.subclass || - gmod->function.protocol) + if (gmod->function.cport || + gmod->function.function_type) return a->mode; return 0; } -- 2.39.5