aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-cache.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-11 09:15:56 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-27 10:01:40 -0400
commit2ac8b6f41a6886dacc88c15c8742e7cd2e40ca7e (patch)
tree82429c2544ea1db89d9c02f4ad8a250cce6cb339 /sound/soc/soc-cache.c
parent94228bcf8c85cfb824e15485285ceb4d5cf080fe (diff)
ASoC: Use explicit endianness conversion in snd_soc_16_8_write()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-cache.c')
-rw-r--r--sound/soc/soc-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 9c688b8a1f91..d1d4059be04e 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -314,9 +314,9 @@ static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
314 unsigned int value) 314 unsigned int value)
315{ 315{
316 u8 data[3]; 316 u8 data[3];
317 u16 rval = cpu_to_be16(reg);
317 318
318 data[0] = (reg >> 8) & 0xff; 319 memcpy(data, &rval, sizeof(rval));
319 data[1] = reg & 0xff;
320 data[2] = value; 320 data[2] = value;
321 reg &= 0xff; 321 reg &= 0xff;
322 322