From 94228bcf8c85cfb824e15485285ceb4d5cf080fe Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 11 May 2011 11:18:00 +0200 Subject: [PATCH] ASoC: Use cpu_to_be16() in 8x16 write Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- sound/soc/soc-cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index dab109f2f47d..9c688b8a1f91 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); } -- 2.20.1