From: bui duc phuc <[email protected]>

Add comments explaining why the .startup() callbacks must return
0 on success to ensure the DAI is correctly marked as started
and prevent future changes from reintroducing the issue.

Signed-off-by: bui duc phuc <[email protected]>
---
 sound/soc/codecs/cs42l42.c | 5 +++++
 sound/soc/codecs/nau8325.c | 5 +++++
 sound/soc/codecs/nau8540.c | 5 +++++
 sound/soc/codecs/nau8821.c | 5 +++++
 sound/soc/codecs/nau8824.c | 5 +++++
 sound/soc/codecs/nau8825.c | 5 +++++
 sound/soc/codecs/wm8580.c  | 5 +++++
 sound/soc/codecs/wm8782.c  | 5 +++++
 8 files changed, 40 insertions(+)

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index f6e4bf6206b7..18d6cb9bfa2c 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -907,6 +907,11 @@ static int cs42l42_dai_startup(struct snd_pcm_substream 
*substream, struct snd_s
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/nau8325.c b/sound/soc/codecs/nau8325.c
index 0902a7d7730d..5ccf4c110567 100644
--- a/sound/soc/codecs/nau8325.c
+++ b/sound/soc/codecs/nau8325.c
@@ -501,6 +501,11 @@ static int nau8325_dai_startup(struct snd_pcm_substream 
*substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/nau8540.c b/sound/soc/codecs/nau8540.c
index 9484388ab262..09e7f31a904d 100644
--- a/sound/soc/codecs/nau8540.c
+++ b/sound/soc/codecs/nau8540.c
@@ -431,6 +431,11 @@ static int nau8540_dai_startup(struct snd_pcm_substream 
*substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c
index 935df063822c..7b88ee3159d1 100644
--- a/sound/soc/codecs/nau8821.c
+++ b/sound/soc/codecs/nau8821.c
@@ -841,6 +841,11 @@ static int nau8821_dai_startup(struct snd_pcm_substream 
*substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
index c89889aa420e..046cce9192b7 100644
--- a/sound/soc/codecs/nau8824.c
+++ b/sound/soc/codecs/nau8824.c
@@ -1073,6 +1073,11 @@ static int nau8824_dai_startup(struct snd_pcm_substream 
*substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 10bbfbb460b1..af2a49c893d3 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1273,6 +1273,11 @@ static int nau8825_dai_startup(struct snd_pcm_substream 
*substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 5343d445c322..cee80da8f753 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -860,6 +860,11 @@ static int wm8580_playback_startup(struct 
snd_pcm_substream *substream,
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
diff --git a/sound/soc/codecs/wm8782.c b/sound/soc/codecs/wm8782.c
index 767251ac4f89..cbf0c823c022 100644
--- a/sound/soc/codecs/wm8782.c
+++ b/sound/soc/codecs/wm8782.c
@@ -46,6 +46,11 @@ static int wm8782_dai_startup(struct snd_pcm_substream *sub, 
struct snd_soc_dai
        if (ret < 0)
                return ret;
 
+       /*
+        * ASoC only marks the DAI as started when .startup() returns 0.
+        * Since snd_pcm_hw_constraint_minmax() may return 1, explicitly
+        * return 0 to ensure the DAI is correctly marked as started.
+        */
        return 0;
 }
 
-- 
2.43.0


Reply via email to