[PATCH 2/4] ASoC: codecs: si476x: Handle hw_params return value
From: phucduc . bui
Date: Fri Oct 23 2026 - 05:03:55 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
snd_soc_component_update_bits() may return 1 when the register value
changes, but ASoC only marks the DAI hw_params as done when .hw_params()
returns 0.
Propagate negative errors and return 0 on success.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/codecs/si476x.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c
index 9b904450ab8a..1738377d7d7c 100644
--- a/sound/soc/codecs/si476x.c
+++ b/sound/soc/codecs/si476x.c
@@ -193,6 +193,12 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream,
goto out;
}
+ /*
+ * ASoC only marks the DAI hw_params as done when .hw_params() returns 0.
+ * Since snd_soc_component_update_bits() may return 1, explicitly
+ * return 0 to ensure the DAI is correctly marked.
+ */
+ err = 0;
out:
si476x_core_unlock(core);
--
2.43.0