ASoC: core: Double control update err for snd_soc_put_volsw_sx
authorMukund Navada <navada@ti.com>
Fri, 9 Nov 2012 06:23:40 +0000 (11:53 +0530)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 9 Nov 2012 16:32:05 +0000 (16:32 +0000)
snd_soc_put_volsw_sx function fails to update second control
if first control is updated by snd_soc_update_bits_locked.

Signed-off-by: Mukund Navada <navada@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
sound/soc/soc-core.c

index d119862..10d21be 100644 (file)
@@ -2786,8 +2786,9 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
        val = (ucontrol->value.integer.value[0] + min) & mask;
        val = val << shift;
 
-       if (snd_soc_update_bits_locked(codec, reg, val_mask, val))
-                       return err;
+       err = snd_soc_update_bits_locked(codec, reg, val_mask, val);
+       if (err < 0)
+               return err;
 
        if (snd_soc_volsw_is_stereo(mc)) {
                val_mask = mask << rshift;