]> git.baikalelectronics.ru Git - kernel.git/commit
Kobject: auto-cleanup on final unref
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 19 Dec 2007 00:40:42 +0000 (01:40 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:39 +0000 (20:40 -0800)
commita71dad593fe369ada98f1d6cd24b2d31f2cb19d6
treef4ded2831853cb6ea328d15d72871db6f8c22610
parent2e2e94c430afd8860c58ea6a82929cf09d197638
Kobject: auto-cleanup on final unref

We save the current state in the object itself, so we can do proper
cleanup when the last reference is dropped.

If the initial reference is dropped, the object will be removed from
sysfs if needed, if an "add" event was sent, "remove" will be send, and
the allocated resources are released.

This allows us to clean up some driver core usage as well as allowing us
to do other such changes to the rest of the kernel.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c
include/linux/kobject.h
lib/kobject.c
lib/kobject_uevent.c