Commit 21ef4b8b authored by Axel Lin's avatar Axel Lin Committed by Dan Williams

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent d0b0c8c7
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
#include <linux/slab.h> #include <linux/slab.h>
static DEFINE_MUTEX(dma_list_mutex); static DEFINE_MUTEX(dma_list_mutex);
static DEFINE_IDR(dma_idr);
static LIST_HEAD(dma_device_list); static LIST_HEAD(dma_device_list);
static long dmaengine_ref_count; static long dmaengine_ref_count;
static struct idr dma_idr;
/* --- sysfs implementation --- */ /* --- sysfs implementation --- */
...@@ -1049,8 +1049,6 @@ EXPORT_SYMBOL_GPL(dma_run_dependencies); ...@@ -1049,8 +1049,6 @@ EXPORT_SYMBOL_GPL(dma_run_dependencies);
static int __init dma_bus_init(void) static int __init dma_bus_init(void)
{ {
idr_init(&dma_idr);
mutex_init(&dma_list_mutex);
return class_register(&dma_devclass); return class_register(&dma_devclass);
} }
arch_initcall(dma_bus_init); arch_initcall(dma_bus_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment