summaryrefslogtreecommitdiff
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-11-21 04:53:18 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-13 15:38:45 -0800
commit44c53c4ff01a3551e9d73604eba42e372e9d0c1a (patch)
tree0c23a5dca8631209cc008ef896e09cfbaf303c41 /drivers/base/class.c
parent1f71740ab9714bf5ae9ee04c724ff0d5c67ca3dc (diff)
driver core: delete virtual directory on class_unregister()
Class virtual directory is created as the need arises. But it is not deleted when the class is unregistered. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> 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, 2 insertions, 0 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index f098881f45b2..8bf2ca2e56b5 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);
}