mirror of
https://github.com/torvalds/linux.git
synced 2026-09-28 12:02:03 +02:00
ASoC: codecs: rt712-sdca-sdw: Simplify regcache error handling in resume
Calling regcache_mark_dirty() on error is redundant as regcache_sync() retains dirty state on failure, and any write in cache_only mode marks the cache dirty anyway. Restore cache_only directly on error for active regmaps and drop the redundant regcache_mark_dirty() calls. This also removes goto labels to prepare for guard cleanup. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260721102600.523199-26-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f8e861f73b
commit
cd1c99ff8c
|
|
@ -473,22 +473,20 @@ static int rt712_sdca_dev_resume(struct device *dev)
|
|||
|
||||
regcache_cache_only(rt712->regmap, false);
|
||||
ret = regcache_sync(rt712->regmap);
|
||||
if (ret)
|
||||
goto err_sync;
|
||||
if (ret) {
|
||||
regcache_cache_only(rt712->regmap, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
regcache_cache_only(rt712->mbq_regmap, false);
|
||||
ret = regcache_sync(rt712->mbq_regmap);
|
||||
if (ret)
|
||||
goto err_sync;
|
||||
if (ret) {
|
||||
regcache_cache_only(rt712->mbq_regmap, true);
|
||||
regcache_cache_only(rt712->regmap, true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_sync:
|
||||
regcache_cache_only(rt712->regmap, true);
|
||||
regcache_cache_only(rt712->mbq_regmap, true);
|
||||
regcache_mark_dirty(rt712->regmap);
|
||||
regcache_mark_dirty(rt712->mbq_regmap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops rt712_sdca_pm = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user