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

From: Andy Shevchenko
Date: Tue Dec 02 2025 - 09:13:23 EST


On Tue, Dec 02, 2025 at 04:35:34PM +0800, Shengjiu Wang wrote:
> Disable regulator in runtime resume when error happens to balance
> the reference count of regulator.

...

> - 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;

ret = regcache_sync(ak4458->regmap);
if (ret)
regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);

return ret;

is also okay in this case.

--
With Best Regards,
Andy Shevchenko