Skip to content

Commit

Permalink
remoteproc: Directly use ida_alloc()/free()
Browse files Browse the repository at this point in the history
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

Signed-off-by: keliu <liuke94@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220527073832.2474641-1-liuke94@huawei.com
  • Loading branch information
keliu authored and Bjorn Andersson committed Jul 18, 2022
1 parent cab8300 commit 08333b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ static void rproc_type_release(struct device *dev)
idr_destroy(&rproc->notifyids);

if (rproc->index >= 0)
ida_simple_remove(&rproc_dev_index, rproc->index);
ida_free(&rproc_dev_index, rproc->index);

kfree_const(rproc->firmware);
kfree_const(rproc->name);
Expand Down Expand Up @@ -2553,9 +2553,9 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
goto put_device;

/* Assign a unique device index and name */
rproc->index = ida_simple_get(&rproc_dev_index, 0, 0, GFP_KERNEL);
rproc->index = ida_alloc(&rproc_dev_index, GFP_KERNEL);
if (rproc->index < 0) {
dev_err(dev, "ida_simple_get failed: %d\n", rproc->index);
dev_err(dev, "ida_alloc failed: %d\n", rproc->index);
goto put_device;
}

Expand Down

0 comments on commit 08333b9

Please sign in to comment.