Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762033AbYAYHnt (ORCPT ); Fri, 25 Jan 2008 02:43:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759379AbYAYHTZ (ORCPT ); Fri, 25 Jan 2008 02:19:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:47722 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758781AbYAYHTX (ORCPT ); Fri, 25 Jan 2008 02:19:23 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Kay Sievers , Matt Domsch , Matt Tolentino Subject: [PATCH 081/196] kset: convert efivars to use kset_create for the vars sub-subsystem. Date: Thu, 24 Jan 2008 23:10:19 -0800 Message-Id: <1201245134-4876-81-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.5.3.8 In-Reply-To: <20080125071127.GA4860@kroah.com> References: <20080125071127.GA4860@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2783 Lines: 90 Dynamically create the kset instead of declaring it statically. Cc: Kay Sievers Cc: Matt Domsch Cc: Matt Tolentino Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/efivars.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 018ca1c..e17cd81 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c @@ -572,7 +572,7 @@ static struct attribute_group efi_subsys_attr_group = { }; -static decl_subsys(vars, NULL); +static struct kset *vars_kset; static struct kset *efi_kset; /* @@ -618,7 +618,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) { @@ -675,12 +675,10 @@ efivars_init(void) goto out_free; } - vars_subsys.kobj.kset = efi_kset; - - error = subsystem_register(&vars_subsys); - - if (error) { - printk(KERN_ERR "efivars: Subsystem registration failed with error %d.\n", error); + vars_kset = kset_create_and_add("vars", NULL, &efi_kset->kobj); + if (!vars_kset) { + printk(KERN_ERR "efivars: Subsystem registration failed.\n"); + error = -ENOMEM; goto out_firmware_unregister; } @@ -715,12 +713,12 @@ efivars_init(void) * Now add attributes to allow creation of new vars * and deletion of existing ones... */ - error = sysfs_create_bin_file(&vars_subsys.kobj, + error = sysfs_create_bin_file(&vars_kset->kobj, &var_subsys_attr_new_var); if (error) printk(KERN_ERR "efivars: unable to create new_var sysfs file" " due to error %d\n", error); - error = sysfs_create_bin_file(&vars_subsys.kobj, + error = sysfs_create_bin_file(&vars_kset->kobj, &var_subsys_attr_del_var); if (error) printk(KERN_ERR "efivars: unable to create del_var sysfs file" @@ -733,7 +731,7 @@ efivars_init(void) else goto out_free; - subsystem_unregister(&vars_subsys); + kset_unregister(vars_kset); out_firmware_unregister: kset_unregister(efi_kset); @@ -756,7 +754,7 @@ efivars_exit(void) efivar_unregister(entry); } - subsystem_unregister(&vars_subsys); + kset_unregister(vars_kset); kset_unregister(efi_kset); } -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/