]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma buffer
authorNicolin Chen <b42378@freescale.com>
Tue, 5 Nov 2013 05:56:52 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:52 +0000 (16:56 +1100)
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>
sound/soc/pxa/mmp-pcm.c

index 8235e231d89c013dd957f08b3336a0d3d3a941e4..7929e19b0ef5970b1942da441770df909f29629e 100644 (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;
 }