aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-02 16:20:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:19 -0500
commit89a07e34b16d9dcdf0a9ada3ca0c9a506b490c8f (patch)
treea62654a7aef7830776b8d48d7268b413ad728801 /drivers/firmware
parent9e5f7f9abe18a4f134585a2de016974cbda80539 (diff)
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efivars.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index ebc38534b02d..018ca1cd82bc 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -573,7 +573,7 @@ static struct attribute_group efi_subsys_attr_group = {
573 573
574 574
575static decl_subsys(vars, NULL); 575static decl_subsys(vars, NULL);
576static decl_subsys(efi, NULL); 576static struct kset *efi_kset;
577 577
578/* 578/*
579 * efivar_create_sysfs_entry() 579 * efivar_create_sysfs_entry()
@@ -668,15 +668,14 @@ efivars_init(void)
668 /* 668 /*
669 * For now we'll register the efi subsys within this driver 669 * For now we'll register the efi subsys within this driver
670 */ 670 */
671 671 efi_kset = kset_create_and_add("efi", NULL, &firmware_kset->kobj);
672 error = firmware_register(&efi_subsys); 672 if (!efi_kset) {
673 673 printk(KERN_ERR "efivars: Firmware registration failed.\n");
674 if (error) { 674 error = -ENOMEM;
675 printk(KERN_ERR "efivars: Firmware registration failed with error %d.\n", error);
676 goto out_free; 675 goto out_free;
677 } 676 }
678 677
679 vars_subsys.kobj.kset = &efi_subsys; 678 vars_subsys.kobj.kset = efi_kset;
680 679
681 error = subsystem_register(&vars_subsys); 680 error = subsystem_register(&vars_subsys);
682 681
@@ -728,7 +727,7 @@ efivars_init(void)
728 " due to error %d\n", error); 727 " due to error %d\n", error);
729 728
730 /* Don't forget the systab entry */ 729 /* Don't forget the systab entry */
731 error = sysfs_create_group(&efi_subsys.kobj, &efi_subsys_attr_group); 730 error = sysfs_create_group(&efi_kset->kobj, &efi_subsys_attr_group);
732 if (error) 731 if (error)
733 printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error); 732 printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error);
734 else 733 else
@@ -737,7 +736,7 @@ efivars_init(void)
737 subsystem_unregister(&vars_subsys); 736 subsystem_unregister(&vars_subsys);
738 737
739out_firmware_unregister: 738out_firmware_unregister:
740 firmware_unregister(&efi_subsys); 739 kset_unregister(efi_kset);
741 740
742out_free: 741out_free:
743 kfree(variable_name); 742 kfree(variable_name);
@@ -758,7 +757,7 @@ efivars_exit(void)
758 } 757 }
759 758
760 subsystem_unregister(&vars_subsys); 759 subsystem_unregister(&vars_subsys);
761 firmware_unregister(&efi_subsys); 760 kset_unregister(efi_kset);
762} 761}
763 762
764module_init(efivars_init); 763module_init(efivars_init);