[PATCH 02/20] ASoC: adau1701: Propagate register cache replay errors

Pengpeng Hou <[email protected]>
Newsgroups gmane.linux.sound,gmane.linux.kernel
Message-ID <[email protected]>
adau1701_reset() marks the cache dirty after firmware and reset setup
but ignores regcache_sync().  The hw_params and component probe callers
return the helper status, so they can currently accept reset completion
while cached register state was not restored.

Return the cache replay error so those effective callers stop the
transition.

The issue was identified via static analysis and manually reviewed.

Fixes: 45405d58924f ("ASoC: adau1701: switch to direct regmap API usage")

Assisted-by: LLM
Signed-off-by: Pengpeng Hou <[email protected]>
---
 sound/soc/codecs/adau1701.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 329ab01b62c0..a5c2d095a0ab 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -355,7 +355,9 @@ static int adau1701_reset(struct snd_soc_component *component, unsigned int clkd
 	regmap_write(adau1701->regmap, ADAU1701_DSPCTRL, ADAU1701_DSPCTRL_CR);
 
 	regcache_mark_dirty(adau1701->regmap);
-	regcache_sync(adau1701->regmap);
+	ret = regcache_sync(adau1701->regmap);
+	if (ret)
+		return ret;
 
 	return 0;
 }
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.