summaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-04-18 21:57:34 -0700
committerGreg KH <greg@press.kroah.org>2005-04-18 21:57:34 -0700
commit18c3d5271b472c096adfc856e107c79f6fd30d7d (patch)
tree1650bafc1dea2402bbb9902ed2d236ab4d4cb50c /lib/kobject.c
parent7b558637b0efc6ab3f3ca08f0b9cc0191665e9db (diff)
downloadblackbird-op-linux-18c3d5271b472c096adfc856e107c79f6fd30d7d.tar.gz
blackbird-op-linux-18c3d5271b472c096adfc856e107c79f6fd30d7d.zip
[PATCH] kobject/hotplug split - kobject add/remove
kobject_add() and kobject_del() don't emit hotplug events anymore. The user should do it itself if it has finished populating the device directory. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index ff9491986b38..5df8441c44e7 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -184,8 +184,6 @@ int kobject_add(struct kobject * kobj)
unlink(kobj);
if (parent)
kobject_put(parent);
- } else {
- kobject_hotplug(kobj, KOBJ_ADD);
}
return error;
@@ -207,7 +205,8 @@ int kobject_register(struct kobject * kobj)
printk("kobject_register failed for %s (%d)\n",
kobject_name(kobj),error);
dump_stack();
- }
+ } else
+ kobject_hotplug(kobj, KOBJ_ADD);
} else
error = -EINVAL;
return error;
@@ -301,7 +300,6 @@ int kobject_rename(struct kobject * kobj, char *new_name)
void kobject_del(struct kobject * kobj)
{
- kobject_hotplug(kobj, KOBJ_REMOVE);
sysfs_remove_dir(kobj);
unlink(kobj);
}
@@ -314,6 +312,7 @@ void kobject_del(struct kobject * kobj)
void kobject_unregister(struct kobject * kobj)
{
pr_debug("kobject %s: unregistering\n",kobject_name(kobj));
+ kobject_hotplug(kobj, KOBJ_REMOVE);
kobject_del(kobj);
kobject_put(kobj);
}
OpenPOWER on IntegriCloud