software node: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/c7cdc3566c783d106138698b1e1923351fabace8.1698831275.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christophe JAILLET 2023-11-01 10:36:04 +01:00 committed by Greg Kroah-Hartman
parent b17b70212d
commit 4c095734d9
1 changed files with 4 additions and 4 deletions

View File

@ -747,10 +747,10 @@ static void software_node_release(struct kobject *kobj)
struct swnode *swnode = kobj_to_swnode(kobj); struct swnode *swnode = kobj_to_swnode(kobj);
if (swnode->parent) { if (swnode->parent) {
ida_simple_remove(&swnode->parent->child_ids, swnode->id); ida_free(&swnode->parent->child_ids, swnode->id);
list_del(&swnode->entry); list_del(&swnode->entry);
} else { } else {
ida_simple_remove(&swnode_root_ids, swnode->id); ida_free(&swnode_root_ids, swnode->id);
} }
if (swnode->allocated) if (swnode->allocated)
@ -776,8 +776,8 @@ swnode_register(const struct software_node *node, struct swnode *parent,
if (!swnode) if (!swnode)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
ret = ida_simple_get(parent ? &parent->child_ids : &swnode_root_ids, ret = ida_alloc(parent ? &parent->child_ids : &swnode_root_ids,
0, 0, GFP_KERNEL); GFP_KERNEL);
if (ret < 0) { if (ret < 0) {
kfree(swnode); kfree(swnode);
return ERR_PTR(ret); return ERR_PTR(ret);