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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
00ed8e3dda
commit
864062457a
@@ -145,6 +145,7 @@ int class_register(struct class * cls)
|
||||
INIT_LIST_HEAD(&cls->children);
|
||||
INIT_LIST_HEAD(&cls->devices);
|
||||
INIT_LIST_HEAD(&cls->interfaces);
|
||||
kset_init(&cls->class_dirs);
|
||||
init_MUTEX(&cls->sem);
|
||||
error = kobject_set_name(&cls->subsys.kset.kobj, "%s", cls->name);
|
||||
if (error)
|
||||
@@ -163,7 +164,6 @@ int class_register(struct class * cls)
|
||||
void class_unregister(struct class * cls)
|
||||
{
|
||||
pr_debug("device class '%s': unregistering\n", cls->name);
|
||||
kobject_unregister(cls->virtual_dir);
|
||||
remove_class_attrs(cls);
|
||||
subsystem_unregister(&cls->subsys);
|
||||
}
|
||||
|
Reference in New Issue
Block a user