2022-02-22 13:41:25

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 09/16] ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put

wcd934x_rx_hph_mode_put currently returns zero eventhough it changes the value.
Fix this, so that change notifications are sent correctly.

Fixes: 1cde8b822332 ("ASoC: wcd934x: add basic controls")
Signed-off-by: Srinivas Kandagatla <[email protected]>
---
sound/soc/codecs/wcd934x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index f2674905a4a7..ab580f37cf00 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -3314,7 +3314,7 @@ static int wcd934x_rx_hph_mode_put(struct snd_kcontrol *kc,
}
wcd->hph_mode = mode_val;

- return 0;
+ return 1;
}

static int slim_rx_mux_get(struct snd_kcontrol *kc,
--
2.21.0


2022-02-22 18:14:50

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 09/16] ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put

On Tue, Feb 22, 2022 at 11:59:26AM +0000, Srinivas Kandagatla wrote:
> wcd934x_rx_hph_mode_put currently returns zero eventhough it changes the value.
> Fix this, so that change notifications are sent correctly.

> - return 0;
> + return 1;

This now has the opposite issue where it will unconditionally flag a
change even if none occurred, that's less bad but still an issue. It
should check to see if the value written is different to that already
set and report that.


Attachments:
(No filename) (483.00 B)
signature.asc (499.00 B)
Download all attachments

2022-02-23 02:39:31

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH 09/16] ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put



On 22/02/2022 17:54, Mark Brown wrote:
> On Tue, Feb 22, 2022 at 11:59:26AM +0000, Srinivas Kandagatla wrote:
>> wcd934x_rx_hph_mode_put currently returns zero eventhough it changes the value.
>> Fix this, so that change notifications are sent correctly.
>
>> - return 0;
>> + return 1;
>
> This now has the opposite issue where it will unconditionally flag a
> change even if none occurred, that's less bad but still an issue. It
> should check to see if the value written is different to that already
> set and report that.
Thanks for spotting this, Yes, that is another issue, Will fix those in
next spin.

--srini