Commit 8f1ec93a authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 78e45c99
...@@ -3212,11 +3212,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol, ...@@ -3212,11 +3212,11 @@ int snd_soc_bytes_get(struct snd_kcontrol *kcontrol,
break; break;
case 2: case 2:
((u16 *)(&ucontrol->value.bytes.data))[0] ((u16 *)(&ucontrol->value.bytes.data))[0]
&= ~params->mask; &= cpu_to_be16(~params->mask);
break; break;
case 4: case 4:
((u32 *)(&ucontrol->value.bytes.data))[0] ((u32 *)(&ucontrol->value.bytes.data))[0]
&= ~params->mask; &= cpu_to_be32(~params->mask);
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment