Skip to content

Commit 92eaf18

Browse files
ujfalusibardliao
authored andcommitted
ASoC: SOF: pcm: Remove local create_page_table() wrapper function
The create_page_table() can be dropped and replaced with a direct call to snd_sof_create_page_table(). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 47046fc commit 92eaf18

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

sound/soc/sof/pcm.c

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@
2020
#include "sof-utils.h"
2121
#include "ops.h"
2222

23-
/* Create DMA buffer page table for DSP */
24-
static int create_page_table(struct snd_soc_component *component,
25-
struct snd_pcm_substream *substream,
26-
unsigned char *dma_area, size_t size)
27-
{
28-
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
29-
struct snd_sof_pcm *spcm;
30-
struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
31-
int stream = substream->stream;
32-
33-
spcm = snd_sof_find_spcm_dai(component, rtd);
34-
if (!spcm)
35-
return -EINVAL;
36-
37-
return snd_sof_create_page_table(component->dev, dmab,
38-
spcm->stream[stream].page_table.area, size);
39-
}
40-
4123
/*
4224
* sof pcm period elapse work
4325
*/
@@ -199,9 +181,11 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,
199181

200182
/* create compressed page table for audio firmware */
201183
if (runtime->buffer_changed) {
202-
ret = create_page_table(component, substream, runtime->dma_area,
203-
runtime->dma_bytes);
184+
struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
204185

186+
ret = snd_sof_create_page_table(component->dev, dmab,
187+
spcm->stream[substream->stream].page_table.area,
188+
runtime->dma_bytes);
205189
if (ret < 0)
206190
return ret;
207191
}

0 commit comments

Comments
 (0)