aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-03-13 22:25:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:57:28 -0400
commit864062457a2e444227bd368ca5f2a2b740de604f (patch)
tree38e516852ee9825b5ffe0b1f2e8abea0a88b1674 /drivers/base/class.c
parent00ed8e3dda47f8421b11da17e353d7db8c878121 (diff)
driver core: fix namespace issue with devices assigned to classes
- uses a kset in "struct class" to keep track of all directories belonging to this class - merges with the /sys/devices/virtual logic. - removes the namespace-dir if the last member of that class leaves the directory. There may be locking or refcounting fixes left, I stopped when it seemed to work with network and sound modules. :) From: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index d5968128be2b..80bbb2074636 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -145,6 +145,7 @@ int class_register(struct class * cls)
145 INIT_LIST_HEAD(&cls->children); 145 INIT_LIST_HEAD(&cls->children);
146 INIT_LIST_HEAD(&cls->devices); 146 INIT_LIST_HEAD(&cls->devices);
147 INIT_LIST_HEAD(&cls->interfaces); 147 INIT_LIST_HEAD(&cls->interfaces);
148 kset_init(&cls->class_dirs);
148 init_MUTEX(&cls->sem); 149 init_MUTEX(&cls->sem);
149 error = kobject_set_name(&cls->subsys.kset.kobj, "%s", cls->name); 150 error = kobject_set_name(&cls->subsys.kset.kobj, "%s", cls->name);
150 if (error) 151 if (error)
@@ -163,7 +164,6 @@ int class_register(struct class * cls)
163void class_unregister(struct class * cls) 164void class_unregister(struct class * cls)
164{ 165{
165 pr_debug("device class '%s': unregistering\n", cls->name); 166 pr_debug("device class '%s': unregistering\n", cls->name);
166 kobject_unregister(cls->virtual_dir);
167 remove_class_attrs(cls); 167 remove_class_attrs(cls);
168 subsystem_unregister(&cls->subsys); 168 subsystem_unregister(&cls->subsys);
169} 169}