lkml.org 
[lkml]   [2005]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/6] 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>

===== lib/kobject.c 1.58 vs edited =====
--- 1.58/lib/kobject.c 2005-03-09 18:04:09 +01:00
+++ edited/lib/kobject.c 2005-03-18 02:17:18 +01:00
@@ -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 * ko
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

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);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.036 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site