aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-02-27 20:04:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:18 -0500
commit15fc61106a203b4601336cdc2dd9efba259d491e (patch)
tree1803fbe90e58d16b9cf8af642fb57c73b3f4054f
parent19dd2da3b4f643b65964a7f340000e27b5556f93 (diff)
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>
-rw-r--r--drivers/remoteproc/remoteproc_core.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 634d36793b72..29387df4bfc9 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -199,11 +199,6 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
199 /* actual size of vring (in bytes) */ 199 /* actual size of vring (in bytes) */
200 size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); 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 * Allocate non-cacheable memory for the vring. In the future 203 * Allocate non-cacheable memory for the vring. In the future
209 * this call will also configure the IOMMU for us 204 * this call will also configure the IOMMU for us
@@ -221,12 +216,13 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
221 * TODO: let the rproc know the notifyid of this vring 216 * TODO: let the rproc know the notifyid of this vring
222 * TODO: support predefined notifyids (via resource table) 217 * TODO: support predefined notifyids (via resource table)
223 */ 218 */
224 ret = idr_get_new(&rproc->notifyids, rvring, &notifyid); 219 ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
225 if (ret) { 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 dma_free_coherent(dev->parent, size, va, dma); 222 dma_free_coherent(dev->parent, size, va, dma);
228 return ret; 223 return ret;
229 } 224 }
225 notifyid = ret;
230 226
231 /* Store largest notifyid */ 227 /* Store largest notifyid */
232 rproc->max_notifyid = max(rproc->max_notifyid, notifyid); 228 rproc->max_notifyid = max(rproc->max_notifyid, notifyid);