summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown2011-06-03 18:09:14 +0200
committerMark Brown2011-06-06 13:48:42 +0200
commit78bf3c9ab69a957dfa58e521ce7fca056c86b980 (patch)
tree37a0b57fe0bce39105a869fe5c7bfaefac4ccca4 /sound/soc/soc-core.c
parentASoC: Error out when FLL lock interrupt is not delivered on WM8915 (diff)
downloadkernel-qcow2-linux-78bf3c9ab69a957dfa58e521ce7fca056c86b980.tar.gz
kernel-qcow2-linux-78bf3c9ab69a957dfa58e521ce7fca056c86b980.tar.xz
kernel-qcow2-linux-78bf3c9ab69a957dfa58e521ce7fca056c86b980.zip
ASoC: Enforce the mask in snd_soc_update_bits()
Avoids issues if someone does a read followed by restore and doesn't mask out only the bits being updated. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 13a40fc78d32..c53f5d589591 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2323,7 +2323,7 @@ int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
return ret;
old = ret;
- new = (old & ~mask) | value;
+ new = (old & ~mask) | (value & mask);
change = old != new;
if (change) {
ret = snd_soc_write(codec, reg, new);