[PATCH v2 21/25] ASoC: renesas: msiof: Remove redundant period constraint
phucduc.bui at gmail.com
phucduc.bui at gmail.com
Wed Oct 14 18:43:20 PDT 2026
From: bui duc phuc <phucduc.bui at gmail.com>
snd_pcm_hw_constraint_integer() is already called by
snd_dmaengine_pcm_open(). Calling it again in msiof_open() is
unnecessary, as the constraint is already applied and the second
call returns 0.
Remove the redundant constraint call.
Signed-off-by: bui duc phuc <phucduc.bui at gmail.com>
---
Changes in v2:
- Remove redundant integer constraints already applied by
snd_dmaengine_pcm_open().
sound/soc/renesas/rcar/msiof.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/sound/soc/renesas/rcar/msiof.c b/sound/soc/renesas/rcar/msiof.c
index 128543fc4fc9..11a6f22ec0ad 100644
--- a/sound/soc/renesas/rcar/msiof.c
+++ b/sound/soc/renesas/rcar/msiof.c
@@ -419,18 +419,14 @@ static int msiof_open(struct snd_soc_component *component,
return PTR_ERR(chan);
ret = snd_dmaengine_pcm_open(substream, chan);
- if (ret < 0)
- goto open_err_dma;
-
- snd_soc_set_runtime_hwparams(substream, &msiof_pcm_hardware);
-
- ret = snd_pcm_hw_constraint_integer(substream->runtime, SNDRV_PCM_HW_PARAM_PERIODS);
-
-open_err_dma:
- if (ret < 0)
+ if (ret < 0) {
dma_release_channel(chan);
+ return ret;
+ }
- return ret;
+ snd_soc_set_runtime_hwparams(substream, &msiof_pcm_hardware);
+
+ return 0;
}
static int msiof_close(struct snd_soc_component *component,
--
2.43.0
More information about the Linux-rockchip
mailing list