{
struct software_node *swnode = kobj_to_swnode(kobj);
- if (swnode->parent) {
- ida_simple_remove(&swnode->parent->child_ids, swnode->id);
- list_del(&swnode->entry);
- } else {
- ida_simple_remove(&swnode_root_ids, swnode->id);
- }
-
ida_destroy(&swnode->child_ids);
property_entries_free(swnode->properties);
kfree(swnode);
INIT_LIST_HEAD(&swnode->children);
swnode->parent = p;
- if (p)
- list_add_tail(&swnode->entry, &p->children);
-
ret = kobject_init_and_add(&swnode->kobj, &software_node_type,
p ? &p->kobj : NULL, "node%d", swnode->id);
if (ret) {
return ERR_PTR(ret);
}
+ if (p)
+ list_add_tail(&swnode->entry, &p->children);
+
kobject_uevent(&swnode->kobj, KOBJ_ADD);
return &swnode->fwnode;
}
if (!swnode)
return;
+ if (swnode->parent) {
+ ida_simple_remove(&swnode->parent->child_ids, swnode->id);
+ list_del(&swnode->entry);
+ } else {
+ ida_simple_remove(&swnode_root_ids, swnode->id);
+ }
+
kobject_put(&swnode->kobj);
}
EXPORT_SYMBOL_GPL(fwnode_remove_software_node);