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

From: Pengpeng Hou

Date: Sat Jul 04 2026 - 03:34:48 EST


rt711_sdca_dev_resume() clears cache-only mode for both regmaps and
replays cached register state. Both regcache_sync() calls currently
ignore their return values.

Check both sync operations, return the first error, and restore both
regmaps to cache-only/dirty state on failure.

Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/rt711-sdca-sdw.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c
index e028a1c3a9ac..c63ea1249a3a 100644
--- a/sound/soc/codecs/rt711-sdca-sdw.c
+++ b/sound/soc/codecs/rt711-sdca-sdw.c
@@ -458,11 +458,24 @@ static int rt711_sdca_dev_resume(struct device *dev)
return ret;
}

- regcache_cache_only(rt711->regmap, false);
- regcache_sync(rt711->regmap);
+ regcache_cache_only(rt711->regmap, false);
+ ret = regcache_sync(rt711->regmap);
+ if (ret)
+ goto err_sync;
+
regcache_cache_only(rt711->mbq_regmap, false);
- regcache_sync(rt711->mbq_regmap);
+ ret = regcache_sync(rt711->mbq_regmap);
+ if (ret)
+ goto err_sync;
+
return 0;
+
+err_sync:
+ regcache_cache_only(rt711->regmap, true);
+ regcache_cache_only(rt711->mbq_regmap, true);
+ regcache_mark_dirty(rt711->regmap);
+ regcache_mark_dirty(rt711->mbq_regmap);
+ return ret;
}

static const struct dev_pm_ops rt711_sdca_pm = {
--
2.43.0