From c1b70ae094d37e379e0c4e14db513e50a8e5bb6f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 19 Apr 2020 14:28:10 +0200 Subject: [PATCH] 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 --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c | 8 ++++---- 1 file 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 7ebcebd80b772..33187ea625bf7 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; -- 2.30.2