[PATCH 4/4] ASoC: fs210x: report register restore errors

From: Pengpeng Hou

Date: Sat Sep 05 2026 - 23:46:02 EST


fs210x_init_chip() marks the register cache dirty and replays it after
reset and scene setup, but ignores a replay failure and publishes
is_inited. Its resume caller already returns the helper status.

Keep is_inited clear and return a cache replay failure so the ASoC
component wrapper can report the incomplete restoration.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: 756117701779 ("ASoC: codecs: Add FourSemi FS2104/5S audio amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
sound/soc/codecs/fs210x.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/fs210x.c b/sound/soc/codecs/fs210x.c
index 510cbeea5b62..316f3fe80d93 100644
--- a/sound/soc/codecs/fs210x.c
+++ b/sound/soc/codecs/fs210x.c
@@ -610,8 +610,9 @@ static int fs210x_init_chip(struct fs210x_priv *fs210x)
if (!ret) {
regcache_cache_only(fs210x->regmap, false);
regcache_mark_dirty(fs210x->regmap);
- regcache_sync(fs210x->regmap);
- fs210x->is_inited = true;
+ ret = regcache_sync(fs210x->regmap);
+ if (!ret)
+ fs210x->is_inited = true;
}

return ret;
--
2.50.1 (Apple Git-155)