Skip to content

Commit 1f8f726

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: ak5558: Disable regulator when error happens
Disable regulator in runtime resume when error happens to balance the reference count of regulator. Fixes: 2ff6d5a ("ASoC: ak5558: Add regulator support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20251203100529.3841203-3-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ae585fa commit 1f8f726

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sound/soc/codecs/ak5558.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,15 @@ static int ak5558_runtime_resume(struct device *dev)
372372
regcache_cache_only(ak5558->regmap, false);
373373
regcache_mark_dirty(ak5558->regmap);
374374

375-
return regcache_sync(ak5558->regmap);
375+
ret = regcache_sync(ak5558->regmap);
376+
if (ret)
377+
goto err;
378+
379+
return 0;
380+
err:
381+
regcache_cache_only(ak5558->regmap, true);
382+
regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies);
383+
return ret;
376384
}
377385

378386
static const struct dev_pm_ops ak5558_pm = {

0 commit comments

Comments
 (0)