public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Hsieh Hung-En <hungen3108@gmail.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: linux-sound@vger.kernel.org, perex@perex.cz, tiwai@suse.com,
	ckeepax@opensource.cirrus.com, kuninori.morimoto.gx@renesas.com,
	matteomartelli3@gmail.com, Hsieh Hung-En <hungen3108@gmail.com>
Subject: [PATCH v1 1/2] ASoC: es8311: Check regcache_sync() error in resume
Date: Wed, 15 Apr 2026 11:02:51 +0800	[thread overview]
Message-ID: <20260415030252.5547-2-hungen3108@gmail.com> (raw)
In-Reply-To: <20260415030252.5547-1-hungen3108@gmail.com>

The es8311_resume() function currently ignores the return value of
regcache_sync(). If syncing the cache fails, the function still returns
0, leaving the codec in a potentially incorrect state.

Check the return value and propagate it to the ASoC core to ensure
resume failures are properly handled.

Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
---
 sound/soc/codecs/es8311.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/es8311.c b/sound/soc/codecs/es8311.c
index 0b07a53cc792..9e371e2d6eae 100644
--- a/sound/soc/codecs/es8311.c
+++ b/sound/soc/codecs/es8311.c
@@ -862,13 +862,18 @@ static int es8311_suspend(struct snd_soc_component *component)
 static int es8311_resume(struct snd_soc_component *component)
 {
 	struct es8311_priv *es8311;
+	int ret;
 
 	es8311 = snd_soc_component_get_drvdata(component);
 
 	es8311_reset(component, false);
 
 	regcache_cache_only(es8311->regmap, false);
-	regcache_sync(es8311->regmap);
+	ret = regcache_sync(es8311->regmap);
+	if (ret) {
+		dev_err(component->dev, "unable to sync regcache\n");
+		return ret;
+	}
 
 	return 0;
 }
-- 
2.34.1


  reply	other threads:[~2026-04-15  3:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15  3:02 [PATCH v1 0/2] ASoC: es8311: Improve error handling and power Hsieh Hung-En
2026-04-15  3:02 ` Hsieh Hung-En [this message]
2026-04-15  3:02 ` [PATCH v1 2/2] ASoC: es8311: Fix clock leak and check update_bits in set_bias_level() Hsieh Hung-En
2026-04-16 12:39 ` [PATCH v1 0/2] ASoC: es8311: Improve error handling and power Mark Brown

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=20260415030252.5547-2-hungen3108@gmail.com \
    --to=hungen3108@gmail.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=matteomartelli3@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox