Commit 44c53c4f authored by Akinobu Mita's avatar Akinobu Mita Committed by Greg Kroah-Hartman

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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1f71740a
...@@ -163,6 +163,8 @@ int class_register(struct class * cls) ...@@ -163,6 +163,8 @@ int class_register(struct class * cls)
void class_unregister(struct class * cls) void class_unregister(struct class * cls)
{ {
pr_debug("device class '%s': unregistering\n", cls->name); pr_debug("device class '%s': unregistering\n", cls->name);
if (cls->virtual_dir)
kobject_unregister(cls->virtual_dir);
remove_class_attrs(cls); remove_class_attrs(cls);
subsystem_unregister(&cls->subsys); subsystem_unregister(&cls->subsys);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment