The es8311_resume() function currently ignores the return value of
regcache_sync(). If syncing the cache fails, the function still returns
0, leaving the codec in a potentially incorrect state.
Check the return value and propagate it to the ASoC core to ensure
resume failures are properly handled.
Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260415030252.5547-2-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
static int es8311_resume(struct snd_soc_component *component)
{
struct es8311_priv *es8311;
+ int ret;
es8311 = snd_soc_component_get_drvdata(component);
es8311_reset(component, false);
regcache_cache_only(es8311->regmap, false);
- regcache_sync(es8311->regmap);
+ ret = regcache_sync(es8311->regmap);
+ if (ret) {
+ dev_err(component->dev, "unable to sync regcache\n");
+ return ret;
+ }
return 0;
}