Commit 15fc61106a203b4601336cdc2dd9efba259d491e
Committed by
Linus Torvalds
1 parent
19dd2da3b4
Exists in
master
and in
20 other branches
remoteproc: convert to idr_alloc()
Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 7 deletions Side-by-side Diff
drivers/remoteproc/remoteproc_core.c
... | ... | @@ -199,11 +199,6 @@ |
199 | 199 | /* actual size of vring (in bytes) */ |
200 | 200 | size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); |
201 | 201 | |
202 | - if (!idr_pre_get(&rproc->notifyids, GFP_KERNEL)) { | |
203 | - dev_err(dev, "idr_pre_get failed\n"); | |
204 | - return -ENOMEM; | |
205 | - } | |
206 | - | |
207 | 202 | /* |
208 | 203 | * Allocate non-cacheable memory for the vring. In the future |
209 | 204 | * this call will also configure the IOMMU for us |
210 | 205 | |
211 | 206 | |
... | ... | @@ -221,12 +216,13 @@ |
221 | 216 | * TODO: let the rproc know the notifyid of this vring |
222 | 217 | * TODO: support predefined notifyids (via resource table) |
223 | 218 | */ |
224 | - ret = idr_get_new(&rproc->notifyids, rvring, ¬ifyid); | |
219 | + ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL); | |
225 | 220 | if (ret) { |
226 | - dev_err(dev, "idr_get_new failed: %d\n", ret); | |
221 | + dev_err(dev, "idr_alloc failed: %d\n", ret); | |
227 | 222 | dma_free_coherent(dev->parent, size, va, dma); |
228 | 223 | return ret; |
229 | 224 | } |
225 | + notifyid = ret; | |
230 | 226 | |
231 | 227 | /* Store largest notifyid */ |
232 | 228 | rproc->max_notifyid = max(rproc->max_notifyid, notifyid); |