[PATCH] ASoC: tas2770: Only treat negative return codes as errors set_tdm_idle
From: James Calligeros
Date: Sat Oct 24 2026 - 06:58:33 EST
snd_soc_component_update_bits returns 1 on a successful update, and
we were returning from tas2770_set_dai_tdm_idle early on any nonzero
return code. Change this so that only negative return codes are
treated as errors.
Fixes: af176d0787d2 ("ASoC: tas2770: expose SDOUT bus keeper via set_tdm_idle")
Signed-off-by: James Calligeros <jcalligeros99@xxxxxxxxx>
---
sound/soc/codecs/tas2770.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index 882e19857697..6b9ec8f630fe 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -513,7 +513,7 @@ static int tas2770_set_dai_tdm_idle(struct snd_soc_dai *dai,
ret = snd_soc_component_update_bits(component, TAS2770_DIN_PD,
TAS2770_DIN_PD_SDOUT,
TAS2770_DIN_PD_SDOUT);
- if (ret)
+ if (ret < 0)
return ret;
break;
@@ -521,12 +521,12 @@ static int tas2770_set_dai_tdm_idle(struct snd_soc_dai *dai,
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
TAS2770_TDM_CFG_REG4_TX_KEEPER,
TAS2770_TDM_CFG_REG4_TX_KEEPER);
- if (ret)
+ if (ret < 0)
return ret;
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
TAS2770_TDM_CFG_REG4_TX_FILL, 0);
- if (ret)
+ if (ret < 0)
return ret;
break;
@@ -534,25 +534,25 @@ static int tas2770_set_dai_tdm_idle(struct snd_soc_dai *dai,
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
TAS2770_TDM_CFG_REG4_TX_KEEPER,
TAS2770_TDM_CFG_REG4_TX_KEEPER);
- if (ret)
+ if (ret < 0)
return ret;
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
TAS2770_TDM_CFG_REG4_TX_FILL,
TAS2770_TDM_CFG_REG4_TX_FILL);
- if (ret)
+ if (ret < 0)
return ret;
break;
case SND_SOC_DAI_TDM_IDLE_OFF:
ret = snd_soc_component_update_bits(component, TAS2770_DIN_PD,
TAS2770_DIN_PD_SDOUT, 0);
- if (ret)
+ if (ret < 0)
return ret;
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
TAS2770_TDM_CFG_REG4_TX_KEEPER, 0);
- if (ret)
+ if (ret < 0)
return ret;
break;
---
base-commit: cc3fc99f1bce93c3ae3771ef98cb91a566da857e
change-id: 20261024-tas2770-idle-fix-b0104e591578
Best regards,
--
James Calligeros <jcalligeros99@xxxxxxxxx>