summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/nvm.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-01-12 00:10:21 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2024-01-23 14:30:20 +0300
commitdec6a613574cd3dea799170b7aaa8fd76e22f176 (patch)
tree73ebd81ca53a726d653daf94d1fe614aa8ee7344 /drivers/thunderbolt/nvm.c
parente8f1297ba31f9a36969c98e41663c508b8fd7fdf (diff)
downloadlinux-dec6a613574cd3dea799170b7aaa8fd76e22f176.tar.xz
thunderbolt: 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(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range()/ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/nvm.c')
-rw-r--r--drivers/thunderbolt/nvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c
index 69fb3b0fa34f..8901db2de327 100644
--- a/drivers/thunderbolt/nvm.c
+++ b/drivers/thunderbolt/nvm.c
@@ -330,7 +330,7 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev)
if (!nvm)
return ERR_PTR(-ENOMEM);
- ret = ida_simple_get(&nvm_ida, 0, 0, GFP_KERNEL);
+ ret = ida_alloc(&nvm_ida, GFP_KERNEL);
if (ret < 0) {
kfree(nvm);
return ERR_PTR(ret);
@@ -528,7 +528,7 @@ void tb_nvm_free(struct tb_nvm *nvm)
nvmem_unregister(nvm->non_active);
nvmem_unregister(nvm->active);
vfree(nvm->buf);
- ida_simple_remove(&nvm_ida, nvm->id);
+ ida_free(&nvm_ida, nvm->id);
}
kfree(nvm);
}