summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-19 14:28:10 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 12:32:14 +0200
commitc1b70ae094d37e379e0c4e14db513e50a8e5bb6f (patch)
treea71a8c09b80b51f8430bdc62096c2f3e335ec3d6
parent8d564cd28cfcbea636b44a96a1edfe0e3395ef60 (diff)
media: atomisp: use new ida API
The old ida API got replaced by a new one, with avoids locking issues. As the old API was removed, start using the new one, as defined by changeset b03f8e43c926 ("ida: Remove old API"). Fixes: b03f8e43c926 ("ida: Remove old API") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c
index 7ebcebd80b77..33187ea625bf 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c
@@ -125,7 +125,7 @@ void atomisp_acc_release(struct atomisp_sub_device *asd)
/* Unload all loaded acceleration binaries */
list_for_each_entry_safe(acc_fw, ta, &asd->acc.fw, list) {
list_del(&acc_fw->list);
- ida_remove(&asd->acc.ida, acc_fw->handle);
+ ida_free(&asd->acc.ida, acc_fw->handle);
acc_free_fw(acc_fw);
}
@@ -175,8 +175,8 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
return -EFAULT;
}
- if (!ida_pre_get(&asd->acc.ida, GFP_KERNEL) ||
- ida_get_new_above(&asd->acc.ida, 1, &handle)) {
+ handle = ida_alloc(&asd->acc.ida, GFP_KERNEL);
+ if (handle < 0) {
acc_free_fw(acc_fw);
return -ENOSPC;
}
@@ -234,7 +234,7 @@ int atomisp_acc_unload(struct atomisp_sub_device *asd, unsigned int *handle)
return -EINVAL;
list_del(&acc_fw->list);
- ida_remove(&asd->acc.ida, acc_fw->handle);
+ ida_free(&asd->acc.ida, acc_fw->handle);
acc_free_fw(acc_fw);
return 0;