Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tejun Heo and committed by
Linus Torvalds
15fc6110 19dd2da3

+3 -7
+3 -7
drivers/remoteproc/remoteproc_core.c
··· 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 ··· 216 221 * TODO: let the rproc know the notifyid of this vring 217 222 * TODO: support predefined notifyids (via resource table) 218 223 */ 219 - ret = idr_get_new(&rproc->notifyids, rvring, &notifyid); 224 + ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL); 220 225 if (ret) { 221 - dev_err(dev, "idr_get_new failed: %d\n", ret); 226 + dev_err(dev, "idr_alloc failed: %d\n", ret); 222 227 dma_free_coherent(dev->parent, size, va, dma); 223 228 return ret; 224 229 } 230 + notifyid = ret; 225 231 226 232 /* Store largest notifyid */ 227 233 rproc->max_notifyid = max(rproc->max_notifyid, notifyid);