summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc_m2m.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2020-03-23 17:32:13 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2020-03-23 17:48:15 +0800
commit6a895a2c4c6941dd35d8308a7af695956c338baa (patch)
tree8f9cda131520ef9cafae2cd86b02be1e3f138acb /sound/soc/fsl/fsl_asrc_m2m.c
parent091d9d8e655d60533f87480ac2f73a5a6b06267a (diff)
MLK-23650-2: ASoC: fsl_asrc_m2m: Fix oops error
Don't need to add one more buffer, if the buffer size is same as ASRC_MAX_BUFFER_SIZE. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc_m2m.c')
-rw-r--r--sound/soc/fsl/fsl_asrc_m2m.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
index ea4f863caee1..406d513ee1cf 100644
--- a/sound/soc/fsl/fsl_asrc_m2m.c
+++ b/sound/soc/fsl/fsl_asrc_m2m.c
@@ -307,7 +307,9 @@ static int fsl_asrc_prepare_io_buffer(struct fsl_asrc_pair *pair,
* (word_size * pair->channels * m2m->watermark[OUT]);
}
- *sg_nodes = *dma_len / ASRC_MAX_BUFFER_SIZE + 1;
+ *sg_nodes = *dma_len / ASRC_MAX_BUFFER_SIZE;
+ if (*dma_len % ASRC_MAX_BUFFER_SIZE)
+ *sg_nodes += 1;
fifo_addr = asrc_priv->paddr + REG_ASRDx(dir, index);