From: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date: Tue, 10 May 2011 23:02:35 +0000 (+0200)
Subject: ASoC: Convert 16x16 write to use cpu_to_be16()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60c655e62f1ee85b9144fa259b3d1064ddbbe847;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

ASoC: Convert 16x16 write to use cpu_to_be16()

Make it clear what we're doing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
---

diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 5cd23daff4ad..6d6395fad486 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -366,14 +366,12 @@ static unsigned int snd_soc_16_16_read(struct snd_soc_codec *codec,
 static int snd_soc_16_16_write(struct snd_soc_codec *codec, unsigned int reg,
 			       unsigned int value)
 {
-	u8 data[4];
+	u16 data[2];
 
-	data[0] = (reg >> 8) & 0xff;
-	data[1] = reg & 0xff;
-	data[2] = (value >> 8) & 0xff;
-	data[3] = value & 0xff;
+	data[0] = cpu_to_be16(reg);
+	data[1] = cpu_to_be16(value);
 
-	return do_hw_write(codec, reg, value, data, 4);
+	return do_hw_write(codec, reg, value, data, sizeof(data));
 }
 
 #if defined(CONFIG_SPI_MASTER)