<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 21, 2022 at 2:58 PM Meng Tang <<a href="mailto:tangmeng@uniontech.com">tangmeng@uniontech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Today, hp_jack_event and mic_jack_event always return 0. However,<br>
snd_soc_dapm_disable_pin and snd_soc_dapm_enable_pin may return a<br>
non-zero value, this will cause the user who calling hp_jack_event<br>
and mic_jack_event don't know whether the operation was really<br>
successfully.<br>
<br>
Signed-off-by: Meng Tang <<a href="mailto:tangmeng@uniontech.com" target="_blank">tangmeng@uniontech.com</a>><br></blockquote><div><br></div><div>Acked-by: Shengjiu Wang <<a href="mailto:shengjiu.wang@gmail.com">shengjiu.wang@gmail.com</a>></div><div> </div><div>Best regards</div><div>Wang Shengjiu</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
sound/soc/fsl/fsl-asoc-card.c | 12 ++++--------<br>
1 file changed, 4 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c<br>
index 370bc790c6ba..d9a0d4768c4d 100644<br>
--- a/sound/soc/fsl/fsl-asoc-card.c<br>
+++ b/sound/soc/fsl/fsl-asoc-card.c<br>
@@ -462,11 +462,9 @@ static int hp_jack_event(struct notifier_block *nb, unsigned long event,<br>
<br>
if (event & SND_JACK_HEADPHONE)<br>
/* Disable speaker if headphone is plugged in */<br>
- snd_soc_dapm_disable_pin(dapm, "Ext Spk");<br>
+ return snd_soc_dapm_disable_pin(dapm, "Ext Spk");<br>
else<br>
- snd_soc_dapm_enable_pin(dapm, "Ext Spk");<br>
-<br>
- return 0;<br>
+ return snd_soc_dapm_enable_pin(dapm, "Ext Spk");<br>
}<br>
<br>
static struct notifier_block hp_jack_nb = {<br>
@@ -481,11 +479,9 @@ static int mic_jack_event(struct notifier_block *nb, unsigned long event,<br>
<br>
if (event & SND_JACK_MICROPHONE)<br>
/* Disable dmic if microphone is plugged in */<br>
- snd_soc_dapm_disable_pin(dapm, "DMIC");<br>
+ return snd_soc_dapm_disable_pin(dapm, "DMIC");<br>
else<br>
- snd_soc_dapm_enable_pin(dapm, "DMIC");<br>
-<br>
- return 0;<br>
+ return snd_soc_dapm_enable_pin(dapm, "DMIC");<br>
}<br>
<br>
static struct notifier_block mic_jack_nb = {<br>
-- <br>
2.20.1<br>
<br>
<br>
<br>
</blockquote></div></div>