[PATCH 05/14] ASoC: nau8540: return cache sync errors from resume

From: Pengpeng Hou

Date: Tue Sep 01 2026 - 21:37:35 EST


nau8540_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.

Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.

The successful resume path is unchanged.

The issue was found by a tool we developed.

Fixes: c1644e3de45d ("ASoC: nau8540: new codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/nau8540.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/nau8540.c b/sound/soc/codecs/nau8540.c
index fefbd5722c00..6c421e2386aa 100644
--- a/sound/soc/codecs/nau8540.c
+++ b/sound/soc/codecs/nau8540.c
@@ -897,9 +897,7 @@ static int __maybe_unused nau8540_resume(struct snd_soc_component *component)
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);

regcache_cache_only(nau8540->regmap, false);
- regcache_sync(nau8540->regmap);
-
- return 0;
+ return regcache_sync(nau8540->regmap);
}

static const struct snd_soc_component_driver nau8540_component_driver = {
--
2.50.1 (Apple Git-155)