Re: [PATCH 1/2] ASoC: ak4458: Disable regulator when error happens

From: Shengjiu Wang
Date: Wed Dec 03 2025 - 01:11:06 EST


On Tue, Dec 2, 2025 at 9:38 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Tue, Dec 02, 2025 at 04:35:34PM +0800, Shengjiu Wang wrote:
>
> > --- a/sound/soc/codecs/ak4458.c
> > +++ b/sound/soc/codecs/ak4458.c
> > @@ -671,7 +671,14 @@ static int ak4458_runtime_resume(struct device *dev)
> > regcache_cache_only(ak4458->regmap, false);
> > regcache_mark_dirty(ak4458->regmap);
> >
> > - return regcache_sync(ak4458->regmap);
> > + ret = regcache_sync(ak4458->regmap);
> > + if (ret)
> > + goto err;
> > +
> > + return 0;
> > +err:
> > + regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
> > + return ret;
>
> While we're at it we should also put the regmap back into cache only
> mode, not that the error is likely to be usefully recoverable.

Thanks, I will update it.

Best regards
Shengjiu Wang