From: phucduc.bui@gmail.com
To: David Rhodes <david.rhodes@cirrus.com>,
Mark Brown <broonie@kernel.org>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Stephan Gerhold <stephan@gerhold.net>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Wentao Liang <vulab@iscas.ac.cn>,
HyeongJun An <sammiee5311@gmail.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 4/4] ASoC: codecs: wm8994: Handle hw_params return value
Date: Fri, 23 Oct 2026 16:01:57 +0700 [thread overview]
Message-ID: <20261023090157.518032-5-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261023090157.518032-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
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@gmail.com>
---
sound/soc/codecs/wm8994.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c65a7769a9d2..6cda0aa4c3be 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3093,6 +3093,7 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
struct wm8994 *control = wm8994->wm8994;
int aif1_reg;
int aif1 = 0;
+ int ret;
switch (dai->id) {
case 3:
@@ -3125,7 +3126,16 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- return snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1);
+ ret = snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1);
+ if (ret < 0)
+ return ret;
+
+ /*
+ * 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.
+ */
+ return 0;
}
static int wm8994_aif_mute(struct snd_soc_dai *codec_dai, int mute,
--
2.43.0
next prev parent reply other threads:[~2026-10-23 9:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 9:01 [PATCH 0/4] ASoC: codecs: Fix hw_params return values phucduc.bui
2026-10-23 9:01 ` [PATCH 1/4] ASoC: codec: cs4341: Handle hw_params return value phucduc.bui
2026-10-23 9:34 ` Charles Keepax
2026-10-23 9:01 ` [PATCH 2/4] ASoC: codecs: si476x: " phucduc.bui
2026-10-23 9:01 ` [PATCH 3/4] ASoC: codecs: tfa989x: " phucduc.bui
2026-10-23 9:01 ` phucduc.bui [this message]
2026-10-23 9:35 ` [PATCH 4/4] ASoC: codecs: wm8994: " Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261023090157.518032-5-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=david.rhodes@cirrus.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=sammiee5311@gmail.com \
--cc=stephan@gerhold.net \
--cc=tiwai@suse.com \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.