提交 89a07e34 编写于 作者: G Greg Kroah-Hartman

kset: convert efivars to use kset_create for the efi subsystem.

Dynamically create the kset instead of declaring it statically.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Matt Tolentino <matthew.e.tolentino@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 9e5f7f9a
...@@ -573,7 +573,7 @@ static struct attribute_group efi_subsys_attr_group = { ...@@ -573,7 +573,7 @@ static struct attribute_group efi_subsys_attr_group = {
static decl_subsys(vars, NULL); static decl_subsys(vars, NULL);
static decl_subsys(efi, NULL); static struct kset *efi_kset;
/* /*
* efivar_create_sysfs_entry() * efivar_create_sysfs_entry()
...@@ -668,15 +668,14 @@ efivars_init(void) ...@@ -668,15 +668,14 @@ efivars_init(void)
/* /*
* For now we'll register the efi subsys within this driver * For now we'll register the efi subsys within this driver
*/ */
efi_kset = kset_create_and_add("efi", NULL, &firmware_kset->kobj);
error = firmware_register(&efi_subsys); if (!efi_kset) {
printk(KERN_ERR "efivars: Firmware registration failed.\n");
if (error) { error = -ENOMEM;
printk(KERN_ERR "efivars: Firmware registration failed with error %d.\n", error);
goto out_free; goto out_free;
} }
vars_subsys.kobj.kset = &efi_subsys; vars_subsys.kobj.kset = efi_kset;
error = subsystem_register(&vars_subsys); error = subsystem_register(&vars_subsys);
...@@ -728,7 +727,7 @@ efivars_init(void) ...@@ -728,7 +727,7 @@ efivars_init(void)
" due to error %d\n", error); " due to error %d\n", error);
/* Don't forget the systab entry */ /* Don't forget the systab entry */
error = sysfs_create_group(&efi_subsys.kobj, &efi_subsys_attr_group); error = sysfs_create_group(&efi_kset->kobj, &efi_subsys_attr_group);
if (error) if (error)
printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error); printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error);
else else
...@@ -737,7 +736,7 @@ efivars_init(void) ...@@ -737,7 +736,7 @@ efivars_init(void)
subsystem_unregister(&vars_subsys); subsystem_unregister(&vars_subsys);
out_firmware_unregister: out_firmware_unregister:
firmware_unregister(&efi_subsys); kset_unregister(efi_kset);
out_free: out_free:
kfree(variable_name); kfree(variable_name);
...@@ -758,7 +757,7 @@ efivars_exit(void) ...@@ -758,7 +757,7 @@ efivars_exit(void)
} }
subsystem_unregister(&vars_subsys); subsystem_unregister(&vars_subsys);
firmware_unregister(&efi_subsys); kset_unregister(efi_kset);
} }
module_init(efivars_init); module_init(efivars_init);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册