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

From: Richard Fitzgerald

Date: Fri Aug 28 2026 - 08:07:21 EST


On 28/08/2026 12:33 pm, Pengpeng Hou wrote:
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;


for context (as the context is missing in this patch), the code
immediately above this already communicated with the device, with
error checks, to determine that (a) the driver can read/write registers
and (b) the device reads back a valid booted state. So we already know
communication is good.

/* 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");