[2.6.29-rc3][PATCH 2/2] ASoC: WM8990: Fix kcontrol's private value use in put callback

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

 



Function wm899x_outpga_put_volsw_vu misuses the kcontrol's private value
by still accessing it as bitfields even SOC_SINGLE_VALUE constructs it
as a pointer into struct soc_mixer_control after the commit
4eaa9819dc08d7bfd1065ce530e31b18a119dcaf.

This is very similar fix than fix to TLV320AIC3X codec made by
Eero Nurkkala <ext-eero.nurkkala@xxxxxxxxx>. This fix is compile tested
only.

Signed-off-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxx>
Cc: Liam Girdwood <lrg@xxxxxxxxxxxxxxx>
---
 sound/soc/codecs/wm8990.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 1cbb7b9..a5731fa 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -176,7 +176,9 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 	struct snd_ctl_elem_value *ucontrol)
 {
 	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-	int reg = kcontrol->private_value & 0xff;
+	struct soc_mixer_control *mc =
+		(struct soc_mixer_control *)kcontrol->private_value;
+	int reg = mc->reg;
 	int ret;
 	u16 val;
 
-- 
1.5.6.5

_______________________________________________
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