lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1201245134-4876-80-git-send-email-gregkh@suse.de>
Date:	Thu, 24 Jan 2008 23:10:18 -0800
From:	Greg Kroah-Hartman <gregkh@...e.de>
To:	linux-kernel@...r.kernel.org
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Kay Sievers <kay.sievers@...y.org>,
	Matt Domsch <Matt_Domsch@...l.com>,
	Matt Tolentino <matthew.e.tolentino@...el.com>
Subject: [PATCH 080/196] 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@...y.org>
Cc: Matt Domsch <Matt_Domsch@...l.com>
Cc: Matt Tolentino <matthew.e.tolentino@...el.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
 drivers/firmware/efivars.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index ebc3853..018ca1c 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -573,7 +573,7 @@ static struct attribute_group efi_subsys_attr_group = {
 
 
 static decl_subsys(vars, NULL);
-static decl_subsys(efi, NULL);
+static struct kset *efi_kset;
 
 /*
  * efivar_create_sysfs_entry()
@@ -668,15 +668,14 @@ efivars_init(void)
 	/*
 	 * For now we'll register the efi subsys within this driver
 	 */
-
-	error = firmware_register(&efi_subsys);
-
-	if (error) {
-		printk(KERN_ERR "efivars: Firmware registration failed with error %d.\n", error);
+	efi_kset = kset_create_and_add("efi", NULL, &firmware_kset->kobj);
+	if (!efi_kset) {
+		printk(KERN_ERR "efivars: Firmware registration failed.\n");
+		error = -ENOMEM;
 		goto out_free;
 	}
 
-	vars_subsys.kobj.kset = &efi_subsys;
+	vars_subsys.kobj.kset = efi_kset;
 
 	error = subsystem_register(&vars_subsys);
 
@@ -728,7 +727,7 @@ efivars_init(void)
 			" due to error %d\n", error);
 
 	/* 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)
 		printk(KERN_ERR "efivars: Sysfs attribute export failed with error %d.\n", error);
 	else
@@ -737,7 +736,7 @@ efivars_init(void)
 	subsystem_unregister(&vars_subsys);
 
 out_firmware_unregister:
-	firmware_unregister(&efi_subsys);
+	kset_unregister(efi_kset);
 
 out_free:
 	kfree(variable_name);
@@ -758,7 +757,7 @@ efivars_exit(void)
 	}
 
 	subsystem_unregister(&vars_subsys);
-	firmware_unregister(&efi_subsys);
+	kset_unregister(efi_kset);
 }
 
 module_init(efivars_init);
-- 
1.5.3.8

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ