diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-12-10 20:13:09 +0300 |
---|---|---|
committer | Ira Weiny <ira.weiny@intel.com> | 2024-01-03 23:21:36 +0300 |
commit | deb369e0828faa245ef3c726b3d5e5f2740ac762 (patch) | |
tree | 7575c84e04bb2d5cbe10efa785de58e42f35dc05 /drivers/nvdimm/btt_devs.c | |
parent | f7e2910fcec1fb2f78888e33ee994653fc29fb15 (diff) | |
download | linux-deb369e0828faa245ef3c726b3d5e5f2740ac762.tar.xz |
nvdimm: 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>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/50719568e4108f65f3b989ba05c1563e17afba3f.1702228319.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Diffstat (limited to 'drivers/nvdimm/btt_devs.c')
-rw-r--r-- | drivers/nvdimm/btt_devs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index fabbb31f2c35..497fd434a6a1 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c @@ -19,7 +19,7 @@ static void nd_btt_release(struct device *dev) dev_dbg(dev, "trace\n"); nd_detach_ndns(&nd_btt->dev, &nd_btt->ndns); - ida_simple_remove(&nd_region->btt_ida, nd_btt->id); + ida_free(&nd_region->btt_ida, nd_btt->id); kfree(nd_btt->uuid); kfree(nd_btt); } @@ -191,7 +191,7 @@ static struct device *__nd_btt_create(struct nd_region *nd_region, if (!nd_btt) return NULL; - nd_btt->id = ida_simple_get(&nd_region->btt_ida, 0, 0, GFP_KERNEL); + nd_btt->id = ida_alloc(&nd_region->btt_ida, GFP_KERNEL); if (nd_btt->id < 0) goto out_nd_btt; @@ -217,7 +217,7 @@ static struct device *__nd_btt_create(struct nd_region *nd_region, return dev; out_put_id: - ida_simple_remove(&nd_region->btt_ida, nd_btt->id); + ida_free(&nd_region->btt_ida, nd_btt->id); out_nd_btt: kfree(nd_btt); |