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

regcache_sync() can fail while replaying cached register state after the
SoundWire slave has reinitialized. rt1318_dev_resume() currently ignores
that failure 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/20260704035437.57792-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pengpeng Hou 2026-07-04 11:54:37 +08:00 committed by Mark Brown
parent 49ea357ea7
commit 2c5e237e7e
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -830,7 +830,12 @@ static int rt1318_dev_resume(struct device *dev)
return ret;
regcache_cache_only(rt1318->regmap, false);
regcache_sync(rt1318->regmap);
ret = regcache_sync(rt1318->regmap);
if (ret) {
regcache_cache_only(rt1318->regmap, true);
regcache_mark_dirty(rt1318->regmap);
return ret;
}
return 0;
}