From: Akinobu Mita Date: Mon, 20 Nov 2006 19:53:18 +0000 (+0900) Subject: driver core: delete virtual directory on class_unregister() X-Git-Tag: v2.6.20-rc1~25 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44c53c4ff01a3551e9d73604eba42e372e9d0c1a;p=pandora-kernel.git 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 Signed-off-by: Greg Kroah-Hartman --- 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); }