Commit 6c422436 authored by Takashi Iwai's avatar Takashi Iwai

ASoC: dmaengine: Drop superfluous PCM preallocation error checks

snd_pcm_lib_preallocate_pages() and co always succeed, so the error
check is simply redundant.  Drop it.
Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8eea18f6
...@@ -270,7 +270,6 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) ...@@ -270,7 +270,6 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
size_t prealloc_buffer_size; size_t prealloc_buffer_size;
size_t max_buffer_size; size_t max_buffer_size;
unsigned int i; unsigned int i;
int ret;
if (config && config->prealloc_buffer_size) { if (config && config->prealloc_buffer_size) {
prealloc_buffer_size = config->prealloc_buffer_size; prealloc_buffer_size = config->prealloc_buffer_size;
...@@ -303,13 +302,11 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) ...@@ -303,13 +302,11 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
return -EINVAL; return -EINVAL;
} }
ret = snd_pcm_lib_preallocate_pages(substream, snd_pcm_lib_preallocate_pages(substream,
SNDRV_DMA_TYPE_DEV_IRAM, SNDRV_DMA_TYPE_DEV_IRAM,
dmaengine_dma_dev(pcm, substream), dmaengine_dma_dev(pcm, substream),
prealloc_buffer_size, prealloc_buffer_size,
max_buffer_size); max_buffer_size);
if (ret)
return ret;
if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i]))
pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE;
......
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