sound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma buffer

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <[email protected]>
Cc: Eric Miao <[email protected]>
Cc: Russell King <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Nicolin Chen authored and Linus Torvalds committed 2013-11-13 12:09:23 +09:00
1 parent 1112b9e2c9
commit 92a2e1cb53
1 file changed
+1 -2
+1 -2
View File
@@ -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;
}