提交 8569be3c 编写于 作者: A Alan Horstmann 提交者: Jaroslav Kysela

sound: ASoC: Fix WM8731 SPI write

Ensure wm8731_spi_write byte order is consistent regardless of
endianess.
Signed-off-by: NAlan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NJaroslav Kysela <perex@perex.cz>
上级 7407a2e4
...@@ -688,12 +688,13 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len) ...@@ -688,12 +688,13 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len)
{ {
struct spi_transfer t; struct spi_transfer t;
struct spi_message m; struct spi_message m;
u16 msg[2]; u8 msg[2];
if (len <= 0) if (len <= 0)
return 0; return 0;
msg[0] = (data[0] << 8) + data[1]; msg[0] = data[0];
msg[1] = data[1];
spi_message_init(&m); spi_message_init(&m);
memset(&t, 0, (sizeof t)); memset(&t, 0, (sizeof t));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册