Commit c1b70ae0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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 b03f8e43 ("ida: Remove old API").

Fixes: b03f8e43 ("ida: Remove old API")
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8d564cd2
...@@ -125,7 +125,7 @@ void atomisp_acc_release(struct atomisp_sub_device *asd) ...@@ -125,7 +125,7 @@ void atomisp_acc_release(struct atomisp_sub_device *asd)
/* Unload all loaded acceleration binaries */ /* Unload all loaded acceleration binaries */
list_for_each_entry_safe(acc_fw, ta, &asd->acc.fw, list) { list_for_each_entry_safe(acc_fw, ta, &asd->acc.fw, list) {
list_del(&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); acc_free_fw(acc_fw);
} }
...@@ -175,8 +175,8 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd, ...@@ -175,8 +175,8 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
return -EFAULT; return -EFAULT;
} }
if (!ida_pre_get(&asd->acc.ida, GFP_KERNEL) || handle = ida_alloc(&asd->acc.ida, GFP_KERNEL);
ida_get_new_above(&asd->acc.ida, 1, &handle)) { if (handle < 0) {
acc_free_fw(acc_fw); acc_free_fw(acc_fw);
return -ENOSPC; return -ENOSPC;
} }
...@@ -234,7 +234,7 @@ int atomisp_acc_unload(struct atomisp_sub_device *asd, unsigned int *handle) ...@@ -234,7 +234,7 @@ int atomisp_acc_unload(struct atomisp_sub_device *asd, unsigned int *handle)
return -EINVAL; return -EINVAL;
list_del(&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); acc_free_fw(acc_fw);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment