sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram buffer
authorNicolin Chen <b42378@freescale.com>
Thu, 14 Nov 2013 22:32:15 +0000 (14:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Nov 2013 00:32:23 +0000 (09:32 +0900)
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
sound/core/memalloc.c

index 9d93f02c6285d7648ea72d99ac5286ab6a45d19f..5e1c7bc73b290b8dba62f6f598eb765ebf054a7f 100644 (file)
@@ -184,11 +184,7 @@ static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
        /* Assign the pool into private_data field */
        dmab->private_data = pool;
 
-       dmab->area = (void *)gen_pool_alloc(pool, size);
-       if (!dmab->area)
-               return;
-
-       dmab->addr = gen_pool_virt_to_phys(pool, (unsigned long)dmab->area);
+       dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr);
 }
 
 /**