From: Nicolin Chen Date: Tue, 12 Nov 2013 23:10:00 +0000 (-0800) Subject: sound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma buffer X-Git-Tag: accepted/tizen/common/20141203.182822~1142^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92a2e1cb53ba649e620b7f02a15ad1fb949c6355;p=platform%2Fkernel%2Flinux-arm64.git 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 Cc: Eric Miao Cc: Russell King Cc: Haojian Zhuang Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c index 8235e23..7929e19 100644 --- a/sound/soc/pxa/mmp-pcm.c +++ b/sound/soc/pxa/mmp-pcm.c @@ -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; }