Skip to contentSkip to conversation

ASoC: fs210x: report register restore errors

PATCH In review Pengpeng Hou 1 participant 1 message Sep 6

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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
---
 sound/soc/codecs/fs210x.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/codecs/fs210x.c +3 -2
index 510cbeea5b62..316f3fe80d93 100644
@@ -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;
Signature · 1 line
2.50.1 (Apple Git-155)