[PATCH] ASoC: codecs: rt1017-sdca-sdw: Propagate regcache_sync() errors

From: Pengpeng Hou

Date: Sat Jul 04 2026 - 03:46:26 EST


rt1017_sdca_dev_resume() waits for SoundWire initialization, leaves
cache-only mode, and replays cached register state. It currently ignores
regcache_sync() failures and returns success.

Propagate the error and restore cache-only/dirty state on failure.

Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/rt1017-sdca-sdw.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt1017-sdca-sdw.c b/sound/soc/codecs/rt1017-sdca-sdw.c
index 95405cea8143..caf75e5657ef 100644
--- a/sound/soc/codecs/rt1017-sdca-sdw.c
+++ b/sound/soc/codecs/rt1017-sdca-sdw.c
@@ -784,7 +784,12 @@ static int rt1017_sdca_dev_resume(struct device *dev)
}

regcache_cache_only(rt1017->regmap, false);
- regcache_sync(rt1017->regmap);
+ ret = regcache_sync(rt1017->regmap);
+ if (ret) {
+ regcache_cache_only(rt1017->regmap, true);
+ regcache_mark_dirty(rt1017->regmap);
+ return ret;
+ }

return 0;
}
--
2.43.0