]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw,enum_virt}()
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 24 Jul 2013 13:27:35 +0000 (15:27 +0200)
committerMark Brown <broonie@linaro.org>
Wed, 24 Jul 2013 13:55:04 +0000 (14:55 +0100)
The ALSA core expect the put callback of a control to return 1 if the value of
the control changed and 0 if it did not. Both snd_soc_dapm_put_volsw() and
snd_soc_dapm_put_enum_virt() currently always returns 0. For both functions we
already have a 'change' variable which either contains 1 or 0 depending on
whether the value has changed or not, so just return that.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-dapm.c

index b94190820e8cfa1b6c24e925f176196cc5efff98..bd16010441cc16fdb26aba40ae5326c427705e81 100644 (file)
@@ -2733,7 +2733,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
        }
 
        mutex_unlock(&card->dapm_mutex);
-       return 0;
+       return change;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
 
@@ -2861,7 +2861,6 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
        struct soc_enum *e =
                (struct soc_enum *)kcontrol->private_value;
        int change;
-       int ret = 0;
        int wi;
 
        if (ucontrol->value.enumerated.item[0] >= e->max)
@@ -2881,7 +2880,7 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
        }
 
        mutex_unlock(&card->dapm_mutex);
-       return ret;
+       return change;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_virt);