ASoC: tas2770: Fix snd_soc_update_bits error handling
Subsystems (5)
PATCH 1/1 ASoC: tas2770: Fix snd_soc_update_bits error handling
According the documentation for snd_soc_update_bits the API will return a 1 if the update was successful with a value change, a 0 if the update was successful with no value change or a negative if the command just failed.
So the value of return in the driver needs to be checked for being less then 0 or the caller may indicate failure when the value actually changed.
--- arch/arm/configs/omap2plus_defconfig | 1 + sound/soc/codecs/tas2770.c | 44 ++++++++++++++++++---------- 2 files changed, 30 insertions(+), 15 deletions(-)
arch/arm/configs/omap2plus_defconfig +1 -0
@@ -395,6 +395,7 @@ CONFIG_SND_SOC_OMAP_ABE_TWL6040=m CONFIG_SND_SOC_OMAP_HDMI=m CONFIG_SND_SOC_CPCAP=m CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SOC_TAS2770=m CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_AUDIO_GRAPH_CARD=m CONFIG_HID_GENERIC=m
sound/soc/codecs/tas2770.c +29 -15
103 lines not on this page · raw message
Signature · 1 line
2.22.0.214.g8dca754b1e
Mark Brown
maintainerarch/arm/configs/omap2plus_defconfig CONFIG_SND_SOC_OMAP_ABE_TWL6040=m · line 401
Quoted 10 lines · Dan Murphy
arch/arm/configs/omap2plus_defconfig +1
-0@@ -395,6 +395,7 @@ CONFIG_SND_SOC_OMAP_ABE_TWL6040=m CONFIG_SND_SOC_OMAP_HDMI=m CONFIG_SND_SOC_CPCAP=m CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SOC_TAS2770=m CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_AUDIO_GRAPH_CARD=m CONFIG_HID_GENERIC=m
This is unrelated and shouldn't be here.
Mark
Quoted 13 lines · Mark Brown
arch/arm/configs/omap2plus_defconfig CONFIG_SND_SOC_OMAP_ABE_TWL6040=m · line 401
Quoted 10 lines · Dan Murphy
arch/arm/configs/omap2plus_defconfig +1
-0@@ -395,6 +395,7 @@ CONFIG_SND_SOC_OMAP_ABE_TWL6040=m CONFIG_SND_SOC_OMAP_HDMI=m CONFIG_SND_SOC_CPCAP=m CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SOC_TAS2770=m CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_AUDIO_GRAPH_CARD=m CONFIG_HID_GENERIC=mThis is unrelated and shouldn't be here.
This is true I added it for test. I also found another instance I missed.
Dan