summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pcm-dma-v2.c
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2019-03-26 15:28:09 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:51:27 +0800
commitba63a9043a76d4e92d32f3d1de5396bfa1c37bb1 (patch)
treeb1d397d070e43b70ac3666eb6ebe1c804e8cd989 /sound/soc/fsl/imx-pcm-dma-v2.c
parent58876d293b56a80f246bf2989bb928a6dc4b6674 (diff)
ASoC: imx: fix build failture
sound/soc/fsl/imx-pcm-dma-v2.c: In function ‘imx_pcm_preallocate_dma_buffer’: sound/soc/fsl/imx-pcm-dma-v2.c:131:6: error: void value not ignored as it ought to be ret = snd_pcm_lib_preallocate_pages(substream, ^ sound/soc/fsl/imx-pcm-dma-v2.c: In function ‘imx_pcm_free_dma_buffers’: sound/soc/fsl/imx-pcm-dma-v2.c:144:2: error: void value not ignored as it ought to be return snd_pcm_lib_preallocate_free(substream); ^ sound/soc/fsl/imx-pcm-dma-v2.c:145:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-pcm-dma-v2.c')
-rw-r--r--sound/soc/fsl/imx-pcm-dma-v2.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/sound/soc/fsl/imx-pcm-dma-v2.c b/sound/soc/fsl/imx-pcm-dma-v2.c
index 4c38efbbf907..d14539332751 100644
--- a/sound/soc/fsl/imx-pcm-dma-v2.c
+++ b/sound/soc/fsl/imx-pcm-dma-v2.c
@@ -99,26 +99,21 @@ static snd_pcm_uframes_t imx_pcm_pointer(struct snd_pcm_substream *substream)
return snd_dmaengine_pcm_pointer(substream);
}
-static int imx_pcm_preallocate_dma_buffer(struct snd_pcm_substream *substream,
+static void imx_pcm_preallocate_dma_buffer(struct snd_pcm_substream *substream,
struct device *dev)
{
size_t size = imx_pcm_hardware.buffer_bytes_max;
- int ret;
- ret = snd_pcm_lib_preallocate_pages(substream,
+ snd_pcm_lib_preallocate_pages(substream,
SNDRV_DMA_TYPE_DEV_IRAM,
dev,
size,
size);
- if (ret)
- return ret;
-
- return 0;
}
-static int imx_pcm_free_dma_buffers(struct snd_pcm_substream *substream)
+static void imx_pcm_free_dma_buffers(struct snd_pcm_substream *substream)
{
- return snd_pcm_lib_preallocate_free(substream);
+ snd_pcm_lib_preallocate_free(substream);
}
static int imx_pcm_open(struct snd_pcm_substream *substream)
@@ -207,9 +202,7 @@ static int imx_pcm_open(struct snd_pcm_substream *substream)
snd_soc_set_runtime_hwparams(substream, &imx_pcm_hardware);
- ret = imx_pcm_preallocate_dma_buffer(substream, chan->device->dev);
- if (ret)
- return ret;
+ imx_pcm_preallocate_dma_buffer(substream, chan->device->dev);
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
@@ -232,11 +225,7 @@ static int imx_pcm_mmap(struct snd_pcm_substream *substream,
static int imx_pcm_close(struct snd_pcm_substream *substream)
{
- int ret;
-
- ret = imx_pcm_free_dma_buffers(substream);
- if (ret)
- return ret;
+ imx_pcm_free_dma_buffers(substream);
return snd_dmaengine_pcm_close_release_chan(substream);
}