Skip to content

Commit

Permalink
sound/core/memalloc.c: use gen_pool_dma_alloc() to allocate iram buffer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolin Chen authored and Linus Torvalds committed Nov 15, 2013
1 parent 0791a60 commit 07968fe
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sound/core/memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 07968fe

Please sign in to comment.