From: Mark Brown Date: Wed, 11 May 2011 13:15:56 +0000 (+0200) Subject: ASoC: Use explicit endianness conversion in snd_soc_16_8_write() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ac8b6f41a6886dacc88c15c8742e7cd2e40ca7e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: Use explicit endianness conversion in snd_soc_16_8_write() Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- 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, unsigned int value) { u8 data[3]; + u16 rval = cpu_to_be16(reg); - data[0] = (reg >> 8) & 0xff; - data[1] = reg & 0xff; + memcpy(data, &rval, sizeof(rval)); data[2] = value; reg &= 0xff;