]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SOF: pcm: Remove local create_page_table() wrapper function
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 19 Jun 2025 10:46:08 +0000 (13:46 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 19 Jun 2025 23:21:14 +0000 (00:21 +0100)
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>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://patch.msgid.link/20250619104608.25947-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pcm.c

index d584a72e6f52fd26735508e4de26c25ca34a2938..acf1995e04e8fe262f9aa12b3168b401a69e9038 100644 (file)
 #include "sof-utils.h"
 #include "ops.h"
 
-/* Create DMA buffer page table for DSP */
-static int create_page_table(struct snd_soc_component *component,
-                            struct snd_pcm_substream *substream,
-                            unsigned char *dma_area, size_t size)
-{
-       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
-       struct snd_sof_pcm *spcm;
-       struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
-       int stream = substream->stream;
-
-       spcm = snd_sof_find_spcm_dai(component, rtd);
-       if (!spcm)
-               return -EINVAL;
-
-       return snd_sof_create_page_table(component->dev, dmab,
-               spcm->stream[stream].page_table.area, size);
-}
-
 /*
  * sof pcm period elapse work
  */
@@ -168,9 +150,11 @@ static int sof_pcm_hw_params(struct snd_soc_component *component,
 
        /* create compressed page table for audio firmware */
        if (runtime->buffer_changed) {
-               ret = create_page_table(component, substream, runtime->dma_area,
-                                       runtime->dma_bytes);
+               struct snd_dma_buffer *dmab = snd_pcm_get_dma_buf(substream);
 
+               ret = snd_sof_create_page_table(component->dev, dmab,
+                               spcm->stream[substream->stream].page_table.area,
+                               runtime->dma_bytes);
                if (ret < 0)
                        return ret;
        }