projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
615f2e5
)
dmaengine: convert to idr_alloc()
author
Tejun Heo
<
[email protected]
>
Thu, 28 Feb 2013 01:04:03 +0000
(17:04 -0800)
committer
Linus Torvalds
<
[email protected]
>
Thu, 28 Feb 2013 03:10:15 +0000
(19:10 -0800)
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo <
[email protected]
>
Cc: Dan Williams <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/dma/dmaengine.c
patch
|
blob
|
history
diff --git
a/drivers/dma/dmaengine.c
b/drivers/dma/dmaengine.c
index 242b8c0a3de8bfb3eea401f13067f3e05143397f..b2728d6ba2fdea97774d904bcd04f58d12187772 100644
(file)
--- a/
drivers/dma/dmaengine.c
+++ b/
drivers/dma/dmaengine.c
@@
-686,18
+686,14
@@
static int get_dma_id(struct dma_device *device)
{
int rc;
- idr_retry:
- if (!idr_pre_get(&dma_idr, GFP_KERNEL))
- return -ENOMEM;
mutex_lock(&dma_list_mutex);
- rc = idr_get_new(&dma_idr, NULL, &device->dev_id);
- mutex_unlock(&dma_list_mutex);
- if (rc == -EAGAIN)
- goto idr_retry;
- else if (rc != 0)
- return rc;
- return 0;
+ rc = idr_alloc(&dma_idr, NULL, 0, 0, GFP_KERNEL);
+ if (rc >= 0)
+ device->dev_id = rc;
+
+ mutex_unlock(&dma_list_mutex);
+ return rc < 0 ? rc : 0;
}
/**