ASoC: rt5682s: stop resume when cache sync fails
Subsystems (3)
PATCH 5/9 ASoC: rt5682s: stop resume when cache sync fails
rt5682s_resume() restores cached registers during component resume but ignores a regcache_sync() failure and continues with jack work scheduling and IRQ enablement. Those operations assume that the codec register state has already been restored.
Stop the local resume sequence when cache replay fails and return the error to the ASoC component wrapper. The wrapper reports the failure while retaining best-effort card resume, so no rollback or retry semantics are introduced.
The issue was found by our static-analysis tool and manually reviewed.
Fixes bdd229ab26be ("ASoC: rt5682s: Add driver for ALC5682I-VS codec")
Assisted-by gpt 5
Signed-off-by Pengpeng Hou <[email protected]>
--- sound/soc/codecs/rt5682s.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/rt5682s.c +4 -1
@@ -2907,9 +2907,12 @@ static int rt5682s_suspend(struct snd_soc_component *component)static int rt5682s_resume (struct snd_soc_component *component) {struct rt5682s_priv *rt5682s =snd_soc_component_get_drvdata (component); +int ret;regcache_cache_only (rt5682s->regmap, false); -regcache_sync (rt5682s->regmap); + ret =regcache_sync (rt5682s->regmap); +if (ret) +return ret;if (rt5682s->hs_jack) { mod_delayed_work(system_power_efficient_wq,
Signature · 1 line
2.50.1 (Apple Git-155)