[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <baf5e846-baef-dd51-c115-f900b37e8c82@csgroup.eu>
Date: Mon, 21 Mar 2022 07:19:19 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Meng Tang <tangmeng@...ontech.com>,
"nicoleotsuka@...il.com" <nicoleotsuka@...il.com>,
"Xiubo.Lee@...il.com" <Xiubo.Lee@...il.com>,
"festevam@...il.com" <festevam@...il.com>,
"shengjiu.wang@...il.com" <shengjiu.wang@...il.com>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>
CC: "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] ASoC: fsl-asoc-card: Fix jack_event() always return 0
Le 21/03/2022 à 07:57, Meng Tang a écrit :
> Today, hp_jack_event and mic_jack_event always return 0. However,
> snd_soc_dapm_disable_pin and snd_soc_dapm_enable_pin may return a
> non-zero value, this will cause the user who calling hp_jack_event
> and mic_jack_event don't know whether the operation was really
> successfully.
>
> Signed-off-by: Meng Tang <tangmeng@...ontech.com>
Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
> sound/soc/fsl/fsl-asoc-card.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
> index 370bc790c6ba..d9a0d4768c4d 100644
> --- a/sound/soc/fsl/fsl-asoc-card.c
> +++ b/sound/soc/fsl/fsl-asoc-card.c
> @@ -462,11 +462,9 @@ static int hp_jack_event(struct notifier_block *nb, unsigned long event,
>
> if (event & SND_JACK_HEADPHONE)
> /* Disable speaker if headphone is plugged in */
> - snd_soc_dapm_disable_pin(dapm, "Ext Spk");
> + return snd_soc_dapm_disable_pin(dapm, "Ext Spk");
> else
> - snd_soc_dapm_enable_pin(dapm, "Ext Spk");
> -
> - return 0;
> + return snd_soc_dapm_enable_pin(dapm, "Ext Spk");
> }
>
> static struct notifier_block hp_jack_nb = {
> @@ -481,11 +479,9 @@ static int mic_jack_event(struct notifier_block *nb, unsigned long event,
>
> if (event & SND_JACK_MICROPHONE)
> /* Disable dmic if microphone is plugged in */
> - snd_soc_dapm_disable_pin(dapm, "DMIC");
> + return snd_soc_dapm_disable_pin(dapm, "DMIC");
> else
> - snd_soc_dapm_enable_pin(dapm, "DMIC");
> -
> - return 0;
> + return snd_soc_dapm_enable_pin(dapm, "DMIC");
> }
>
> static struct notifier_block mic_jack_nb = {
Powered by blists - more mailing lists