summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/renoir
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-07-31 10:43:31 +0200
committerMark Brown <broonie@kernel.org>2021-08-02 12:14:00 +0100
commit8b5d95313b6d30f642e4ed0125891984c446604e (patch)
tree13a26568ea814f2be05e1424ffe48757ce19d509 /sound/soc/amd/renoir
parent1d25684e22516f1cff77176d288b1da02fff57bb (diff)
downloadlinux-8b5d95313b6d30f642e4ed0125891984c446604e.tar.bz2
ASoC: amd: Fix reference to PCM buffer address
PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210731084331.32225-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/renoir')
-rw-r--r--sound/soc/amd/renoir/acp3x-pdm-dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index bd20622b0933..0391c28dd078 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -242,7 +242,7 @@ static int acp_pdm_dma_hw_params(struct snd_soc_component *component,
return -EINVAL;
size = params_buffer_bytes(params);
period_bytes = params_period_bytes(params);
- rtd->dma_addr = substream->dma_buffer.addr;
+ rtd->dma_addr = substream->runtime->dma_addr;
rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT);
config_acp_dma(rtd, substream->stream);
init_pdm_ring_buffer(MEM_WINDOW_START, size, period_bytes,