[PATCH 11/24] ASoC: codecs: nau8325: Ensure the DAI is marked as started on success
From: phucduc . bui
Date: Thu Oct 08 2026 - 06:42:55 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned
from nau8325_dai_startup(). ASoC only marks the DAI as started when
.startup() returns 0.
This currently has no functional impact, as nau8325_dai_ops has no
.shutdown() callback. Still, return 0 explicitly on success to
match what ASoC expects and ensure the DAI is correctly marked as
started.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/codecs/nau8325.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/nau8325.c b/sound/soc/codecs/nau8325.c
index 2c95ed00a681..0902a7d7730d 100644
--- a/sound/soc/codecs/nau8325.c
+++ b/sound/soc/codecs/nau8325.c
@@ -489,14 +489,19 @@ static int nau8325_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_component *component = dai->component;
struct nau8325 *nau8325 = snd_soc_component_get_drvdata(component);
const struct nau8325_osr_attr *osr;
+ int ret;
osr = nau8325_get_osr(nau8325);
if (!osr || !osr->osr)
return -EINVAL;
- return snd_pcm_hw_constraint_minmax(substream->runtime,
- SNDRV_PCM_HW_PARAM_RATE,
- 0, CLK_DA_AD_MAX / osr->osr);
+ ret = snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_RATE,
+ 0, CLK_DA_AD_MAX / osr->osr);
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
static int nau8325_hw_params(struct snd_pcm_substream *substream,
--
2.43.0