[PATCH 08/24] ASoC: apple: mca: Ensure the DAI is marked as started on success
phucduc.bui at gmail.com
phucduc.bui at gmail.com
Thu Oct 8 03:38:15 PDT 2026
From: bui duc phuc <phucduc.bui at gmail.com>
snd_pcm_hw_constraint_minmax() may return 1, which is then returned
from mca_fe_startup(). ASoC only marks the DAI as started when
.startup() returns 0.
This currently has no functional impact, as mca_fe_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 at gmail.com>
---
sound/soc/apple/mca.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c
index be702b2942a5..3585432ad49b 100644
--- a/sound/soc/apple/mca.c
+++ b/sound/soc/apple/mca.c
@@ -516,6 +516,7 @@ static int mca_fe_startup(struct snd_pcm_substream *substream,
{
struct mca_cluster *cl = mca_dai_to_cluster(dai);
unsigned int mask, nchannels;
+ int ret;
if (cl->tdm_slots) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -528,9 +529,13 @@ static int mca_fe_startup(struct snd_pcm_substream *substream,
nchannels = 2;
}
- return snd_pcm_hw_constraint_minmax(substream->runtime,
- SNDRV_PCM_HW_PARAM_CHANNELS,
- 1, nchannels);
+ ret = snd_pcm_hw_constraint_minmax(substream->runtime,
+ SNDRV_PCM_HW_PARAM_CHANNELS,
+ 1, nchannels);
+ if (ret < 0)
+ return ret;
+
+ return 0;
}
static int mca_fe_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,
--
2.43.0
More information about the Linux-rockchip
mailing list