Dynamically create the kset instead of declaring it statically.
Cc: Kay Sievers <[email protected]>
Cc: Matt Domsch <[email protected]>
Cc: Matt Tolentino <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/firmware/efivars.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index c2383ac..362c5a5 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -443,7 +443,7 @@ static struct attribute_group efi_subsys_attr_group = {
};
-static decl_subsys(vars, NULL);
+static struct kset *vars_kset;
static struct kset *efi_kset;
/*
@@ -489,7 +489,7 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
efi_guid_unparse(vendor_guid, short_name + strlen(short_name));
kobject_set_name(&new_efivar->kobj, "%s", short_name);
- new_efivar->kobj.kset = &vars_subsys;
+ new_efivar->kobj.kset = vars_kset;
new_efivar->kobj.ktype = &efivar_ktype;
i = kobject_register(&new_efivar->kobj);
if (i) {
@@ -546,11 +546,9 @@ efivars_init(void)
goto out_free;
}
- vars_subsys.kobj.kset = efi_kset;
-
- error = subsystem_register(&vars_subsys);
-
- if (error) {
+ vars_kset = kset_create_and_register("vars", NULL, NULL, efi_kset);
+ if (IS_ERR(vars_kset)) {
+ error = PTR_ERR(vars_kset);
printk(KERN_ERR "efivars: Subsystem registration failed with error %d.\n", error);
goto out_firmware_unregister;
}
@@ -589,7 +587,7 @@ efivars_init(void)
else
goto out_free;
- subsystem_unregister(&vars_subsys);
+ kset_unregister(vars_kset);
out_firmware_unregister:
kset_unregister(efi_kset);
@@ -612,7 +610,7 @@ efivars_exit(void)
efivar_unregister(entry);
}
- subsystem_unregister(&vars_subsys);
+ kset_unregister(vars_kset);
kset_unregister(efi_kset);
}
--
1.5.3.4
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]