Skip to content

Commit

Permalink
sound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma 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>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
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 torvalds committed Nov 13, 2013
1 parent 1112b9e commit 92a2e1c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/pxa/mmp-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,9 @@ static int mmp_pcm_preallocate_dma_buffer(struct snd_pcm_substream *substream,
if (!gpool)
return -ENOMEM;

buf->area = (unsigned char *)gen_pool_alloc(gpool, size);
buf->area = gen_pool_dma_alloc(gpool, size, &buf->addr);
if (!buf->area)
return -ENOMEM;
buf->addr = gen_pool_virt_to_phys(gpool, (unsigned long)buf->area);
buf->bytes = size;
return 0;
}
Expand Down

0 comments on commit 92a2e1c

Please sign in to comment.