ASoC: codecs: wcd937x-sdw: Propagate regcache_sync() errors

wcd937x_sdw_runtime_resume() leaves cache-only mode and replays cached
register state when a regmap is present. 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@iscas.ac.cn>
Link: https://patch.msgid.link/20260704072236.70862-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pengpeng Hou
2026-07-09 16:55:30 +01:00
committed by Mark Brown
parent ca571406c5
commit a1d01870b4
+7 -1
View File
@@ -1084,10 +1084,16 @@ static int wcd937x_sdw_runtime_suspend(struct device *dev)
static int wcd937x_sdw_runtime_resume(struct device *dev)
{
struct wcd937x_sdw_priv *wcd = dev_get_drvdata(dev);
int ret;
if (wcd->regmap) {
regcache_cache_only(wcd->regmap, false);
regcache_sync(wcd->regmap);
ret = regcache_sync(wcd->regmap);
if (ret) {
regcache_cache_only(wcd->regmap, true);
regcache_mark_dirty(wcd->regmap);
return ret;
}
}
return 0;