]> www.infradead.org Git - users/willy/linux.git/commitdiff
media: atomisp: use new ida API
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 19 Apr 2020 12:28:10 +0000 (14:28 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 10:32:14 +0000 (12:32 +0200)
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>
drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c

index 7ebcebd80b772eb2d30013ff0d91e3527c4053c5..33187ea625bf7897541a276a78140dab25b4d4d7 100644 (file)
@@ -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;