diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2013-11-29 13:33:11 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-29 15:09:44 +0000 |
commit | 8f1ec93ae94e95e717283575997dd134a4c5397f (patch) | |
tree | 98565edd56b352119cadefbae12b1a1fc1663258 /sound/soc | |
parent | 78e45c99f6d470e6069c8669ee533c97cc5fd296 (diff) | |
download | linux-8f1ec93ae94e95e717283575997dd134a4c5397f.tar.bz2 |
ASoC: core: Use consistent byte ordering in snd_soc_bytes_get
snd_soc_bytes_put treats the data in the binary control as big endian
words, however snd_soc_bytes_get uses the endian of the host machine.
This causes the two functions to be inconsistant with how the mask is
applied on little endian machines.
This patch applies the big_endian format used in snd_soc_bytes_put to
snd_soc_bytes_get.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4e53d87e881d..a66783e13a9c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3212,11 +3212,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, break; case 2: ((u16 *)(&ucontrol->value.bytes.data))[0] - &= ~params->mask; + &= cpu_to_be16(~params->mask); break; case 4: ((u32 *)(&ucontrol->value.bytes.data))[0] - &= ~params->mask; + &= cpu_to_be32(~params->mask); break; default: return -EINVAL; |