Skip to content

Commit

Permalink
driver core: delete virtual directory on class_unregister()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Greg Kroah-Hartman committed Dec 13, 2006
1 parent 1f71740 commit 44c53c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 44c53c4

Please sign in to comment.