summaryrefslogtreecommitdiff
path: root/sound/soc/soc-cache.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-11 11:18:00 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-27 22:00:58 +0800
commit94228bcf8c85cfb824e15485285ceb4d5cf080fe (patch)
tree2c93b31feb26546426840737ac0a2c124b30cde8 /sound/soc/soc-cache.c
parentf06f136fe0217174657e325279672d4b73ed4d87 (diff)
downloadlinux-3.10-94228bcf8c85cfb824e15485285ceb4d5cf080fe.tar.gz
linux-3.10-94228bcf8c85cfb824e15485285ceb4d5cf080fe.tar.bz2
linux-3.10-94228bcf8c85cfb824e15485285ceb4d5cf080fe.zip
ASoC: Use cpu_to_be16() in 8x16 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 dab109f2f47..9c688b8a1f9 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -192,10 +192,10 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value)
{
u8 data[3];
+ u16 val = cpu_to_be16(value);
data[0] = reg;
- data[1] = (value >> 8) & 0xff;
- data[2] = value & 0xff;
+ memcpy(&data[1], &val, sizeof(val));
return do_hw_write(codec, reg, value, data, 3);
}