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>
unlink(kobj);
if (parent)
kobject_put(parent);
- } else {
- kobject_hotplug(kobj, KOBJ_ADD);
}
return error;
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;
void kobject_del(struct kobject * kobj)
{
- kobject_hotplug(kobj, KOBJ_REMOVE);
sysfs_remove_dir(kobj);
unlink(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);
}