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>

authored by Akinobu Mita and committed by Greg Kroah-Hartman 44c53c4f 1f71740a

+2
+2
drivers/base/class.c
··· 163 void class_unregister(struct class * cls) 164 { 165 pr_debug("device class '%s': unregistering\n", cls->name); 166 remove_class_attrs(cls); 167 subsystem_unregister(&cls->subsys); 168 }
··· 163 void class_unregister(struct class * cls) 164 { 165 pr_debug("device class '%s': unregistering\n", cls->name); 166 + if (cls->virtual_dir) 167 + kobject_unregister(cls->virtual_dir); 168 remove_class_attrs(cls); 169 subsystem_unregister(&cls->subsys); 170 }