Skip to content

Commit ae585fa

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

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sound/soc/codecs/ak4458.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,15 @@ static int ak4458_runtime_resume(struct device *dev)
671671
regcache_cache_only(ak4458->regmap, false);
672672
regcache_mark_dirty(ak4458->regmap);
673673

674-
return regcache_sync(ak4458->regmap);
674+
ret = regcache_sync(ak4458->regmap);
675+
if (ret)
676+
goto err;
677+
678+
return 0;
679+
err:
680+
regcache_cache_only(ak4458->regmap, true);
681+
regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
682+
return ret;
675683
}
676684

677685
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {

0 commit comments

Comments
 (0)