[PATCH RFC 1/1] ASoC: WL1273 FM Radio: Eliminate unnecessary error return value.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With this change it's not a error to call wl1273_set_audio_route
when the codec is active if the new routing value is the same
as the current active setting.

Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@xxxxxxxxx>
---
 sound/soc/codecs/wl1273.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c
index a2323be..1bb0c83 100644
--- a/sound/soc/codecs/wl1273.c
+++ b/sound/soc/codecs/wl1273.c
@@ -50,6 +50,9 @@ static int wl1273_set_audio_route(struct snd_kcontrol *kcontrol,
 	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
 	struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
 
+	if (wl1273->mode == ucontrol->value.integer.value[0])
+		return 0;
+
 	/* Do not allow changes while stream is running */
 	if (codec->active)
 		return -EPERM;
-- 
1.6.1.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux