mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-18 16:51:07 +00:00
ASoC: es8328: Add error unwind in resume
[ Upstream commit 8232e6079ae6f8d3a61d87973cb427385aa469b9 ] Handle failures in the resume path by unwinding previously enabled resources. If enabling regulators or syncing the regcache fails, disable regulators and unprepare the clock to avoid leaking resources and leaving the device in a partially resumed state. Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com> Link: https://patch.msgid.link/20260130160017.2630-6-hungen3108@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
This commit is contained in:
committed by
Ulrich Hecht
parent
0fea5433cc
commit
fc5a43dfd0
@ -753,17 +753,23 @@ static int es8328_resume(struct snd_soc_component *component)
|
||||
es8328->supplies);
|
||||
if (ret) {
|
||||
dev_err(component->dev, "unable to enable regulators\n");
|
||||
return ret;
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
regcache_mark_dirty(regmap);
|
||||
ret = regcache_sync(regmap);
|
||||
if (ret) {
|
||||
dev_err(component->dev, "unable to sync regcache\n");
|
||||
return ret;
|
||||
goto err_regulators;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_regulators:
|
||||
regulator_bulk_disable(ARRAY_SIZE(es8328->supplies), es8328->supplies);
|
||||
err_clk:
|
||||
clk_disable_unprepare(es8328->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int es8328_component_probe(struct snd_soc_component *component)
|
||||
|
||||
Reference in New Issue
Block a user