[PATCH 10/14] ASoC: rt1318: return cache sync errors from resume

From: Pengpeng Hou

Date: Tue Sep 01 2026 - 21:34:31 EST


rt1318_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: fe1ff61487ac ("ASoC: rt1318: Add RT1318 audio amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/rt1318.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt1318.c b/sound/soc/codecs/rt1318.c
index 55607f1b9a1e..3dcec7564b82 100644
--- a/sound/soc/codecs/rt1318.c
+++ b/sound/soc/codecs/rt1318.c
@@ -1075,8 +1075,7 @@ static int rt1318_resume(struct snd_soc_component *component)
struct rt1318_priv *rt1318 = snd_soc_component_get_drvdata(component);

regcache_cache_only(rt1318->regmap, false);
- regcache_sync(rt1318->regmap);
- return 0;
+ return regcache_sync(rt1318->regmap);
}
#else
#define rt1318_suspend NULL
--
2.50.1 (Apple Git-155)