diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-02-12 16:41:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-07 20:04:51 -0500 |
commit | 361795b1eb7c08e9e65a2ebb4a4e536294d378a2 (patch) | |
tree | 332cd308be3b0bfb6421c0af6a0ad6e1331b0880 /kernel/module.c | |
parent | 35960258ed388cdcebdb71df35fd5126978ca325 (diff) |
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
A little more whack-a-mole annotating the dynamic sysfs attributes. I
had everything built into my earlier test kernel, and so I missed
these.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index e5538d5f00ad..c968d3606dca 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1085,6 +1085,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, | |||
1085 | if (sattr->name == NULL) | 1085 | if (sattr->name == NULL) |
1086 | goto out; | 1086 | goto out; |
1087 | sect_attrs->nsections++; | 1087 | sect_attrs->nsections++; |
1088 | sysfs_attr_init(&sattr->mattr.attr); | ||
1088 | sattr->mattr.show = module_sect_show; | 1089 | sattr->mattr.show = module_sect_show; |
1089 | sattr->mattr.store = NULL; | 1090 | sattr->mattr.store = NULL; |
1090 | sattr->mattr.attr.name = sattr->name; | 1091 | sattr->mattr.attr.name = sattr->name; |
@@ -1180,6 +1181,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect, | |||
1180 | if (sect_empty(&sechdrs[i])) | 1181 | if (sect_empty(&sechdrs[i])) |
1181 | continue; | 1182 | continue; |
1182 | if (sechdrs[i].sh_type == SHT_NOTE) { | 1183 | if (sechdrs[i].sh_type == SHT_NOTE) { |
1184 | sysfs_bin_attr_init(nattr); | ||
1183 | nattr->attr.name = mod->sect_attrs->attrs[loaded].name; | 1185 | nattr->attr.name = mod->sect_attrs->attrs[loaded].name; |
1184 | nattr->attr.mode = S_IRUGO; | 1186 | nattr->attr.mode = S_IRUGO; |
1185 | nattr->size = sechdrs[i].sh_size; | 1187 | nattr->size = sechdrs[i].sh_size; |
@@ -1252,6 +1254,7 @@ int module_add_modinfo_attrs(struct module *mod) | |||
1252 | if (!attr->test || | 1254 | if (!attr->test || |
1253 | (attr->test && attr->test(mod))) { | 1255 | (attr->test && attr->test(mod))) { |
1254 | memcpy(temp_attr, attr, sizeof(*temp_attr)); | 1256 | memcpy(temp_attr, attr, sizeof(*temp_attr)); |
1257 | sysfs_attr_init(&temp_attr->attr); | ||
1255 | error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); | 1258 | error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); |
1256 | ++temp_attr; | 1259 | ++temp_attr; |
1257 | } | 1260 | } |