[alsa-devel] [PATCH 1/6] ASoC: Fix WM8731 SPI write

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Sep 15 15:25:01 CEST 2008


From: Alan Horstmann <gineera at aspect135.co.uk>

Ensure wm8731_spi_write byte order is consistent regardless of
endianess.

Signed-off-by: Alan Horstmann <gineera at aspect135.co.uk>
Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8731.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 975befd..7b64d9a 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -688,12 +688,13 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
 {
 	struct spi_transfer t;
 	struct spi_message m;
-	u16 msg[2];
+	u8 msg[2];
 
 	if (len <= 0)
 		return 0;
 
-	msg[0] = (data[0] << 8) + data[1];
+	msg[0] = data[0];
+	msg[1] = data[1];
 
 	spi_message_init(&m);
 	memset(&t, 0, (sizeof t));
-- 
1.5.6.5



More information about the Alsa-devel mailing list