[PATCH] ASoC: wm_adsp: Fix event generation for wm_adsp_fw_put()

Richard Fitzgerald rf at opensource.cirrus.com
Mon Jun 6 11:39:30 CEST 2022


On 03/06/2022 12:50, Mark Brown wrote:
> Currently wm_adsp_fw_put() returns 0 rather than 1 when updating the value
> of the control, meaning that no event is generated to userspace. Fix this
> by setting the default return value to 1, the code already exits early with
> a return value of 0 if the value is unchanged.
> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>   sound/soc/codecs/wm_adsp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
> index 7973a75cac05..6d7fd88243aa 100644
> --- a/sound/soc/codecs/wm_adsp.c
> +++ b/sound/soc/codecs/wm_adsp.c
> @@ -333,7 +333,7 @@ int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
>   	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
>   	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
>   	struct wm_adsp *dsp = snd_soc_component_get_drvdata(component);
> -	int ret = 0;
> +	int ret = 1;
>   
>   	if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw)
>   		return 0;
> 
Reviewed-by: Richard Fitzgerald <rf at opensource.cirrus.com>


More information about the Alsa-devel mailing list