diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-01-11 22:10:21 +0100 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2024-01-23 12:30:20 +0100 |
commit | dec6a613574cd3dea799170b7aaa8fd76e22f176 (patch) | |
tree | 73ebd81ca53a726d653daf94d1fe614aa8ee7344 /drivers/thunderbolt/nvm.c | |
parent | thunderbolt: Fix rollback in tb_port_lane_bonding_enable() for lane 1 (diff) | |
download | linux-dec6a613574cd3dea799170b7aaa8fd76e22f176.tar.xz linux-dec6a613574cd3dea799170b7aaa8fd76e22f176.zip |
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.c | 4 |
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); } |