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: <1194047972-9850-48-git-send-email-gregkh@suse.de>
Date:	Fri,  2 Nov 2007 16:59:26 -0700
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>,
	Thibaut VARENE <varenet@...isc-linux.org>,
	Matthew Wilcox <matthew@....cx>,
	Grant Grundler <grundler@...isc-linux.org>,
	Kyle McMartin <kyle@...isc-linux.org>
Subject: [PATCH 48/54] kset: convert parisc/pdc_stable.c to use kset_create

Dynamically create the kset instead of declaring it statically.
This makes the kobject attributes now work properly that I broke in the
previous patch.

Cc: Kay Sievers <kay.sievers@...y.org>
Cc: Thibaut VARENE <varenet@...isc-linux.org>
Cc: Matthew Wilcox <matthew@....cx>
Cc: Grant Grundler <grundler@...isc-linux.org>
Cc: Kyle McMartin <kyle@...isc-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
 drivers/parisc/pdc_stable.c |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index e1b9cba..3d71fea 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -960,8 +960,8 @@ static struct attribute_group pdcs_attr_group = {
 	.attrs = pdcs_subsys_attrs,
 };
 
-static decl_subsys(paths, NULL);
-static decl_subsys(stable, NULL);
+static struct kset *stable_kset;
+static struct kset *paths_kset;
 
 /**
  * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage.
@@ -993,7 +993,7 @@ pdcs_register_pathentries(void)
 
 		if ((err = kobject_set_name(&entry->kobj, "%s", entry->name)))
 			return err;
-		entry->kobj.kset = &paths_subsys;
+		entry->kobj.kset = paths_kset;
 		entry->kobj.ktype = &ktype_pdcspath;
 		if ((err = kobject_register(&entry->kobj)))
 			return err;
@@ -1058,19 +1058,26 @@ pdc_stable_init(void)
 	/* the actual result is 16 bits away */
 	pdcs_osid = (u16)(result >> 16);
 
-	/* For now we'll register the stable subsys within this driver */
-	if ((rc = firmware_register(&stable_subsys)))
+	/* For now we'll register the stable kset within this driver */
+	stable_kset = kset_create_and_register("stable", NULL, NULL,
+					       firmware_kset);
+	if (IS_ERR(stable_kset)) {
+		rc = PTR_ERR(stable_kset);
 		goto fail_firmreg;
+	}
 
 	/* Don't forget the root entries */
-	error = sysfs_create_group(&stable_subsys.kobj, pdcs_attr_group);
-
-	/* register the paths subsys as a subsystem of stable subsys */
-	paths_subsys.kobj.kset = &stable_subsys;
-	if ((rc = subsystem_register(&paths_subsys)))
-		goto fail_subsysreg;
+	error = sysfs_create_group(&stable_kset->kobj, pdcs_attr_group);
+
+	/* register the paths kset as a child of the stable kset */
+	paths_kset = kset_create_and_register("paths", NULL, NULL,
+					      stable_kset);
+	if (IS_ERR(paths_kset)) {
+		rc = PTR_ERR(paths_kset);
+		goto fail_ksetreg;
+	}
 
-	/* now we create all "files" for the paths subsys */
+	/* now we create all "files" for the paths kset */
 	if ((rc = pdcs_register_pathentries()))
 		goto fail_pdcsreg;
 
@@ -1078,10 +1085,10 @@ pdc_stable_init(void)
 	
 fail_pdcsreg:
 	pdcs_unregister_pathentries();
-	subsystem_unregister(&paths_subsys);
+	kset_unregister(paths_kset);
 	
-fail_subsysreg:
-	firmware_unregister(&stable_subsys);
+fail_ksetreg:
+	kset_unregister(stable_kset);
 	
 fail_firmreg:
 	printk(KERN_INFO PDCS_PREFIX " bailing out\n");
@@ -1092,9 +1099,8 @@ static void __exit
 pdc_stable_exit(void)
 {
 	pdcs_unregister_pathentries();
-	subsystem_unregister(&paths_subsys);
-
-	firmware_unregister(&stable_subsys);
+	kset_unregister(paths_kset);
+	kset_unregister(stable_kset);
 }
 
 
-- 
1.5.3.4

-
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