[PATCH 13/20] ASoC: wm8804: Propagate cache replay errors from runtime resume

From: Pengpeng Hou

Date: Fri Aug 28 2026 - 07:42:23 EST


wm8804_runtime_resume() enables supplies and ignores regcache_sync(),
then powers up OSCCLK and reports runtime-PM success.

Return the cache error and disable the supplies acquired by resume
before OSCCLK is enabled.

The issue was identified via static analysis and manually reviewed.

Fixes: 1a60667fc81f ("ASoC: wm8804: Enable runtime PM")

Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/wm8804.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8804.c b/sound/soc/codecs/wm8804.c
index 94aa3c8de0ab..0935e2e3c2d4 100644
--- a/sound/soc/codecs/wm8804.c
+++ b/sound/soc/codecs/wm8804.c
@@ -692,7 +692,11 @@ static int wm8804_runtime_resume(struct device *dev)
return ret;
}

- regcache_sync(wm8804->regmap);
+ ret = regcache_sync(wm8804->regmap);
+ if (ret) {
+ regulator_bulk_disable(ARRAY_SIZE(wm8804->supplies), wm8804->supplies);
+ return ret;
+ }

/* Power up OSCCLK */
regmap_update_bits(wm8804->regmap, WM8804_PWRDN, 0x8, 0x0);
--
2.43.0