ASoC: WL1273 FM Radio: Eliminate unnecessary error return value.
authorMatti J. Aaltonen <matti.j.aaltonen@nokia.com>
Fri, 10 Sep 2010 07:41:30 +0000 (10:41 +0300)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Sat, 11 Sep 2010 08:03:21 +0000 (09:03 +0100)
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@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
sound/soc/codecs/wl1273.c

index 0cd590970883b6030198684bfbbe0d5747af7896..0c47c788ccdf74add7dcd92ed8fab0c068e2f7dd 100644 (file)
@@ -193,6 +193,9 @@ static int snd_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;