Skip to content

Commit

Permalink
dmaengine: use DEFINE_IDR for static initialization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Dan Williams committed Aug 4, 2011
1 parent d0b0c8c commit 21ef4b8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/dma/dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
#include <linux/slab.h>

static DEFINE_MUTEX(dma_list_mutex);
static DEFINE_IDR(dma_idr);
static LIST_HEAD(dma_device_list);
static long dmaengine_ref_count;
static struct idr dma_idr;

/* --- sysfs implementation --- */

Expand Down Expand Up @@ -1049,8 +1049,6 @@ EXPORT_SYMBOL_GPL(dma_run_dependencies);

static int __init dma_bus_init(void)
{
idr_init(&dma_idr);
mutex_init(&dma_list_mutex);
return class_register(&dma_devclass);
}
arch_initcall(dma_bus_init);
Expand Down

0 comments on commit 21ef4b8

Please sign in to comment.