mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
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>
This commit is contained in:
parent
51b3b5cabb
commit
78bf3c9ab6
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue