From 44dd970be94a468c60e0745536f29115dd40d368 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 24 Oct 2014 17:54:02 +0800 Subject: [PATCH] greybus: module: enable all sysfs attributes We were thinking that module attributes were known at the time the device was created in the system, so we could query them to know if the sysfs file was present or not. Unfortunatly that's not the case, we create the device before we parse the values, so just always show the sysfs attributes. If there is no such attribute, the sysfs file will be empty (i.e. for the string attributes.) Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/sysfs.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/greybus/sysfs.c b/drivers/staging/greybus/sysfs.c index 2777b8cf5b3a..42d54eb07377 100644 --- a/drivers/staging/greybus/sysfs.c +++ b/drivers/staging/greybus/sysfs.c @@ -74,27 +74,8 @@ static struct attribute *module_attrs[] = { NULL, }; -static umode_t module_attrs_are_visible(struct kobject *kobj, - struct attribute *a, int n) -{ - struct gb_module *gmod = to_gb_module(kobj_to_dev(kobj)); - umode_t mode = a->mode; - - if (a == &dev_attr_module_vendor_string.attr && gmod->vendor_string) - return mode; - if (a == &dev_attr_module_product_string.attr && gmod->product_string) - return mode; - if (gmod->vendor || gmod->product || gmod->version) - return mode; - if (gmod->unique_id) - return mode; - - return 0; -} - static struct attribute_group module_attr_grp = { .attrs = module_attrs, - .is_visible = module_attrs_are_visible, }; const struct attribute_group *greybus_module_groups[] = { -- 2.39.5