Skip to content

Commit 8a1f7fd

Browse files
tititiou36alexdeucher
authored andcommitted
drm/amdgpu: 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() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 733965a commit 8a1f7fd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ int amdgpu_pasid_alloc(unsigned int bits)
6262
int pasid = -EINVAL;
6363

6464
for (bits = min(bits, 31U); bits > 0; bits--) {
65-
pasid = ida_simple_get(&amdgpu_pasid_ida,
66-
1U << (bits - 1), 1U << bits,
67-
GFP_KERNEL);
65+
pasid = ida_alloc_range(&amdgpu_pasid_ida, 1U << (bits - 1),
66+
(1U << bits) - 1, GFP_KERNEL);
6867
if (pasid != -ENOSPC)
6968
break;
7069
}
@@ -82,7 +81,7 @@ int amdgpu_pasid_alloc(unsigned int bits)
8281
void amdgpu_pasid_free(u32 pasid)
8382
{
8483
trace_amdgpu_pasid_freed(pasid);
85-
ida_simple_remove(&amdgpu_pasid_ida, pasid);
84+
ida_free(&amdgpu_pasid_ida, pasid);
8685
}
8786

8887
static void amdgpu_pasid_free_cb(struct dma_fence *fence,

0 commit comments

Comments
 (0)