Skip to content

Commit

Permalink
firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API
Browse files Browse the repository at this point in the history
Replace the deprecated ida_simple_{get,remove} with ida_{alloc,free}.

Link: https://lore.kernel.org/r/20220616055052.4559-1-liubo03@inspur.com
Signed-off-by: Bo Liu <liubo03@inspur.com>
[sudeep.holla: Replace ida_alloc_min with ida_alloc as suggested by Cristian]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
  • Loading branch information
Bo Liu authored and Sudeep Holla committed Jun 27, 2022
1 parent 75c8f43 commit 4ce7e51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/firmware/arm_scmi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
return NULL;
}

id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
id = ida_alloc_min(&scmi_bus_id, 1, GFP_KERNEL);
if (id < 0) {
kfree_const(scmi_dev->name);
kfree(scmi_dev);
Expand All @@ -204,15 +204,15 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol,
put_dev:
kfree_const(scmi_dev->name);
put_device(&scmi_dev->dev);
ida_simple_remove(&scmi_bus_id, id);
ida_free(&scmi_bus_id, id);
return NULL;
}

void scmi_device_destroy(struct scmi_device *scmi_dev)
{
kfree_const(scmi_dev->name);
scmi_handle_put(scmi_dev->handle);
ida_simple_remove(&scmi_bus_id, scmi_dev->id);
ida_free(&scmi_bus_id, scmi_dev->id);
device_unregister(&scmi_dev->dev);
}

Expand Down

0 comments on commit 4ce7e51

Please sign in to comment.