diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-07 16:56:19 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:25 -0500 |
commit | bc87d2fe7a1190f1c257af8a91fc490b1ee35954 (patch) | |
tree | 9aa7caacf38347cc208e300bfaa0e209e77c3be8 /drivers/firmware/efivars.c | |
parent | 6e90aa972dda8ef86155eefcdbdc8d34165b9f39 (diff) |
kobject: convert efivars to use kobject_create
Using a kset for this simple directory is an overkill.
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/efivars.c')
-rw-r--r-- | drivers/firmware/efivars.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index d1ad48190af..7f9f086106c 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 | ||
575 | static struct kset *vars_kset; | 575 | static struct kset *vars_kset; |
576 | static struct kset *efi_kset; | 576 | static struct kobject *efi_kobj; |
577 | 577 | ||
578 | /* | 578 | /* |
579 | * efivar_create_sysfs_entry() | 579 | * efivar_create_sysfs_entry() |
@@ -665,17 +665,15 @@ efivars_init(void) | |||
665 | printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, | 665 | printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION, |
666 | EFIVARS_DATE); | 666 | EFIVARS_DATE); |
667 | 667 | ||
668 | /* | 668 | /* For now we'll register the efi directory at /sys/firmware/efi */ |
669 | * For now we'll register the efi subsys within this driver | 669 | efi_kobj = kobject_create_and_add("efi", firmware_kobj); |
670 | */ | 670 | if (!efi_kobj) { |
671 | efi_kset = kset_create_and_add("efi", NULL, firmware_kobj); | ||
672 | if (!efi_kset) { | ||
673 | printk(KERN_ERR "efivars: Firmware registration failed.\n"); | 671 | printk(KERN_ERR "efivars: Firmware registration failed.\n"); |
674 | error = -ENOMEM; | 672 | error = -ENOMEM; |
675 | goto out_free; | 673 | goto out_free; |
676 | } | 674 | } |
677 | 675 | ||
678 | vars_kset = kset_create_and_add("vars", NULL, &efi_kset->kobj); | 676 | vars_kset = kset_create_and_add("vars", NULL, efi_kobj); |
679 | if (!vars_kset) { | 677 | if (!vars_kset) { |
680 | printk(KERN_ERR "efivars: Subsystem registration failed.\n"); | 678 | printk(KERN_ERR "efivars: Subsystem registration failed.\n"); |
681 | error = -ENOMEM; | 679 | error = -ENOMEM; |
@@ -725,7 +723,7 @@ efivars_init(void) | |||
725 | " due to error %d\n", error); | 723 | " due to error %d\n", error); |
726 | 724 | ||
727 | /* Don't forget the systab entry */ | 725 | /* Don't forget the systab entry */ |
728 | error = sysfs_create_group(&efi_kset->kobj, &efi_subsys_attr_group); | 726 | error = sysfs_create_group(efi_kobj, &efi_subsys_attr_group); |
729 | if (error) | 727 | if (error) |
730 | printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error); | 728 | printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error); |
731 | else | 729 | else |
@@ -734,7 +732,7 @@ efivars_init(void) | |||
734 | kset_unregister(vars_kset); | 732 | kset_unregister(vars_kset); |
735 | 733 | ||
736 | out_firmware_unregister: | 734 | out_firmware_unregister: |
737 | kset_unregister(efi_kset); | 735 | kobject_unregister(efi_kobj); |
738 | 736 | ||
739 | out_free: | 737 | out_free: |
740 | kfree(variable_name); | 738 | kfree(variable_name); |
@@ -755,7 +753,7 @@ efivars_exit(void) | |||
755 | } | 753 | } |
756 | 754 | ||
757 | kset_unregister(vars_kset); | 755 | kset_unregister(vars_kset); |
758 | kset_unregister(efi_kset); | 756 | kobject_unregister(efi_kobj); |
759 | } | 757 | } |
760 | 758 | ||
761 | module_init(efivars_init); | 759 | module_init(efivars_init); |