[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9e5cee313366d72939f6991ef0a265c8c8da6404.1411724724.git.jslaby@suse.cz>
Date: Fri, 26 Sep 2014 11:44:49 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Daniel Mack <zonque@...il.com>,
Mark Brown <broonie@...aro.org>, Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 078/142] ASoC: adau1701: fix adau1701_reg_read()
From: Daniel Mack <zonque@...il.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 3ad80b828b2533f37c221e2df155774efd6ed814 upstream.
Fix a long standing bug in the read register routing of adau1701.
The bytes arrive in the buffer in big-endian, so the result has to be
shifted before and-ing the bytes in the loop.
Signed-off-by: Daniel Mack <zonque@...il.com>
Acked-by: Lars-Peter Clausen <lars@...afoo.de>
Signed-off-by: Mark Brown <broonie@...aro.org>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
sound/soc/codecs/adau1701.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index adee866f463f..56bfc679f437 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -230,8 +230,10 @@ static int adau1701_reg_read(void *context, unsigned int reg,
*value = 0;
- for (i = 0; i < size; i++)
- *value |= recv_buf[i] << (i * 8);
+ for (i = 0; i < size; i++) {
+ *value <<= 8;
+ *value |= recv_buf[i];
+ }
return 0;
}
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists