projects/linux·commit 44c53c4f

driver core: delete virtual directory on class_unregister()

44c53c4f · Akinobu Mita <[email protected]> · 2006-11-21 04:53:18 +09:00

Class virtual directory is created as the need arises.
But it is not deleted when the class is unregistered.

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit
44c53c4ff01a3551e9d73604eba42e372e9d0c1a
Parents
1f71740a

Changes

1 files changed · +2 −0

FileStatusAddDelContent
drivers/base/class.cmodified+2−0View file

drivers/base/class.c

View file
diff --git a/drivers/base/class.c b/drivers/base/class.c
index f098881..8bf2ca2 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -163,6 +163,8 @@ int class_register(struct class * cls)
void class_unregister(struct class * cls)
{
pr_debug("device class '%s': unregistering\n", cls->name);
+ if (cls->virtual_dir)
+ kobject_unregister(cls->virtual_dir);
remove_class_attrs(cls);
subsystem_unregister(&cls->subsys);
}