Skip to content

Commit 07968fe

Browse files
Nicolin Chentorvalds
authored andcommitted
sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram buffer
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>
1 parent 0791a60 commit 07968fe

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎sound/core/memalloc.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,7 @@ static void snd_malloc_dev_iram(struct snd_dma_buffer *dmab, size_t size)
184184
/* Assign the pool into private_data field */
185185
dmab->private_data = pool;
186186

187-
dmab->area = (void *)gen_pool_alloc(pool, size);
188-
if (!dmab->area)
189-
return;
190-
191-
dmab->addr = gen_pool_virt_to_phys(pool, (unsigned long)dmab->area);
187+
dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr);
192188
}
193189

194190
/**

0 commit comments

Comments
 (0)