[PATCH 03/20] ASoC: cs35l56: Propagate register restore errors from runtime resume

From: Pengpeng Hou

Date: Fri Aug 28 2026 - 07:36:55 EST


cs35l56_runtime_resume_common() checks firmware wake and mailbox errors
but ignores the BOOT_DONE read and register-cache replay. A failed read
also leaves val undefined before the BOOT_DONE test.

Send both failures through the existing hibernate error path so
cache-only state is restored and the device is returned to hibernate
when supported.

The issue was identified via static analysis and manually reviewed.

Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")

Assisted-by: LLM
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
sound/soc/codecs/cs35l56-shared.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 7b3e37d462d6..3778c5c2d910 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -827,13 +827,18 @@ int cs35l56_runtime_resume_common(struct cs35l56_base *cs35l56_base, bool is_sou
goto err;

/* BOOT_DONE will be 1 if the amp reset */
- regmap_read(cs35l56_base->regmap, CS35L56_IRQ1_EINT_4, &val);
+ ret = regmap_read(cs35l56_base->regmap, CS35L56_IRQ1_EINT_4, &val);
+ if (ret)
+ goto err;
+
if (val & CS35L56_OTP_BOOT_DONE_MASK) {
dev_dbg(cs35l56_base->dev, "Registers reset in suspend\n");
regcache_mark_dirty(cs35l56_base->regmap);
}

- regcache_sync(cs35l56_base->regmap);
+ ret = regcache_sync(cs35l56_base->regmap);
+ if (ret)
+ goto err;

dev_dbg(cs35l56_base->dev, "Resumed");

--
2.43.0