diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-07-19 23:32:28 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-08-04 01:25:39 -0400 |
commit | 21ef4b8b7a7d59a995bf44382de38c95587767d4 (patch) | |
tree | c658c556af756d7a7eec889810d185c7afca7088 /drivers/dma | |
parent | d0b0c8c79b26a1f48e1e92a2c073655159e72b7c (diff) |
dmaengine: use DEFINE_IDR for static initialization
We could use DEFINE_IDR for statically allocated idr
that allow us to save a few lines of code.
And also remove unneeded mutex_init() for dma_list_mutex, as
dma_list_mutex is initialized automatically by DEFINE_MUTEX().
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dmaengine.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 8bcb15fb959d..bc11eebff44d 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -61,9 +61,9 @@ | |||
61 | #include <linux/slab.h> | 61 | #include <linux/slab.h> |
62 | 62 | ||
63 | static DEFINE_MUTEX(dma_list_mutex); | 63 | static DEFINE_MUTEX(dma_list_mutex); |
64 | static DEFINE_IDR(dma_idr); | ||
64 | static LIST_HEAD(dma_device_list); | 65 | static LIST_HEAD(dma_device_list); |
65 | static long dmaengine_ref_count; | 66 | static long dmaengine_ref_count; |
66 | static struct idr dma_idr; | ||
67 | 67 | ||
68 | /* --- sysfs implementation --- */ | 68 | /* --- sysfs implementation --- */ |
69 | 69 | ||
@@ -1049,8 +1049,6 @@ EXPORT_SYMBOL_GPL(dma_run_dependencies); | |||
1049 | 1049 | ||
1050 | static int __init dma_bus_init(void) | 1050 | static int __init dma_bus_init(void) |
1051 | { | 1051 | { |
1052 | idr_init(&dma_idr); | ||
1053 | mutex_init(&dma_list_mutex); | ||
1054 | return class_register(&dma_devclass); | 1052 | return class_register(&dma_devclass); |
1055 | } | 1053 | } |
1056 | arch_initcall(dma_bus_init); | 1054 | arch_initcall(dma_bus_init); |