Skip to content

Commit

Permalink
net: nfc: 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
keliu authored and davem330 committed May 28, 2022
1 parent 0649e4d commit 9117991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/nfc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ static void nfc_release(struct device *d)
kfree(se);
}

ida_simple_remove(&nfc_index_ida, dev->idx);
ida_free(&nfc_index_ida, dev->idx);

kfree(dev);
}
Expand Down Expand Up @@ -1066,7 +1066,7 @@ struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops,
if (!dev)
return NULL;

rc = ida_simple_get(&nfc_index_ida, 0, 0, GFP_KERNEL);
rc = ida_alloc(&nfc_index_ida, GFP_KERNEL);
if (rc < 0)
goto err_free_dev;
dev->idx = rc;
Expand Down

0 comments on commit 9117991

Please sign in to comment.