[lvc-project] [PATCH 1/2] ASoC: codecs: wsa881x: propagate sdw_write() error from bus_config

Andrey Karelin a.karelin at ideco.ru
Fri Oct 16 17:33:35 MSK 2026


wsa881x_bus_config() programs the clock divider for the next bank via
sdw_write() but ignores its result and always returns 0. A failed write
is therefore hidden from sdw_notify_config(), which aborts programming
of the stream parameters when a bus_config callback fails, and the
amplifier may keep running with a wrong clock configuration after the
bank switch.

Return the result of sdw_write() instead.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a0aab9e1404a ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: Andrey Karelin <a.karelin at ideco.ru>
---
 sound/soc/codecs/wsa881x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c
index 47ac3e4985a5..0fc7132c0a9c 100644
--- a/sound/soc/codecs/wsa881x.c
+++ b/sound/soc/codecs/wsa881x.c
@@ -1093,10 +1093,8 @@ static int wsa881x_port_prep(struct sdw_slave *slave,
 static int wsa881x_bus_config(struct sdw_slave *slave,
 			      struct sdw_bus_params *params)
 {
-	sdw_write(slave, SWRS_SCP_HOST_CLK_DIV2_CTL_BANK(params->next_bank),
-		  0x01);
-
-	return 0;
+	return sdw_write(slave, SWRS_SCP_HOST_CLK_DIV2_CTL_BANK(params->next_bank),
+			 0x01);
 }
 
 static const struct sdw_slave_ops wsa881x_slave_ops = {
-- 
2.56.0





More information about the lvc-project mailing list