]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: module: enable all sysfs attributes
authorGreg Kroah-Hartman <greg@kroah.com>
Fri, 24 Oct 2014 09:54:02 +0000 (17:54 +0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 24 Oct 2014 10:36:24 +0000 (18:36 +0800)
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 <greg@kroah.com>
drivers/staging/greybus/sysfs.c

index 2777b8cf5b3ac0be6b9d5caf9f9b73442e3259ed..42d54eb07377e20ac99f2056c4ac7251961cecc9 100644 (file)
@@ -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[] = {