Commit 1112b9e2 authored by Nicolin Chen's avatar Nicolin Chen Committed by Linus Torvalds

sound/soc/davinci/davinci-pcm.c: use gen_pool_dma_alloc() in davinci-pcm.c

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: default avatarNicolin Chen <b42378@freescale.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 288342e9
...@@ -267,10 +267,9 @@ static int allocate_sram(struct snd_pcm_substream *substream, ...@@ -267,10 +267,9 @@ static int allocate_sram(struct snd_pcm_substream *substream,
return 0; return 0;
ppcm->period_bytes_max = size; ppcm->period_bytes_max = size;
iram_virt = (void *)gen_pool_alloc(sram_pool, size); iram_virt = gen_pool_dma_alloc(sram_pool, size, &iram_phys);
if (!iram_virt) if (!iram_virt)
goto exit1; goto exit1;
iram_phys = gen_pool_virt_to_phys(sram_pool, (unsigned)iram_virt);
iram_dma = kzalloc(sizeof(*iram_dma), GFP_KERNEL); iram_dma = kzalloc(sizeof(*iram_dma), GFP_KERNEL);
if (!iram_dma) if (!iram_dma)
goto exit2; goto exit2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment