aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);