Commit 9357fc3b authored by keliu's avatar keliu Committed by Greg Kroah-Hartman

drivers: spmi: Directly use ida_alloc()/free()

Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .
Signed-off-by: default avatarkeliu <liuke94@huawei.com>
Link: https://lore.kernel.org/r/20220527071338.2359733-1-liuke94@huawei.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20220930005019.2663064-2-sboyd@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 54d0999f
...@@ -35,7 +35,7 @@ static void spmi_ctrl_release(struct device *dev) ...@@ -35,7 +35,7 @@ static void spmi_ctrl_release(struct device *dev)
{ {
struct spmi_controller *ctrl = to_spmi_controller(dev); struct spmi_controller *ctrl = to_spmi_controller(dev);
ida_simple_remove(&ctrl_ida, ctrl->nr); ida_free(&ctrl_ida, ctrl->nr);
kfree(ctrl); kfree(ctrl);
} }
...@@ -457,7 +457,7 @@ struct spmi_controller *spmi_controller_alloc(struct device *parent, ...@@ -457,7 +457,7 @@ struct spmi_controller *spmi_controller_alloc(struct device *parent,
ctrl->dev.of_node = parent->of_node; ctrl->dev.of_node = parent->of_node;
spmi_controller_set_drvdata(ctrl, &ctrl[1]); spmi_controller_set_drvdata(ctrl, &ctrl[1]);
id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); id = ida_alloc(&ctrl_ida, GFP_KERNEL);
if (id < 0) { if (id < 0) {
dev_err(parent, dev_err(parent,
"unable to allocate SPMI controller identifier.\n"); "unable to allocate SPMI controller identifier.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment