summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorMichael Welling <mwelling@ieee.org>2015-05-06 11:49:17 -0500
committerJonathan Cameron <jic23@kernel.org>2015-05-07 11:12:20 +0100
commit0e81bc99a0826db4cd2d6ba9a982579b1467a79f (patch)
treead5c9125446f561812810fd542850fba23aad2b3 /drivers/iio
parent1d93353da536d3403ac291dc96070f434f6cf285 (diff)
iio: mcp320x: Fix occasional incorrect readings
Without the cacheline alignment, the readings will occasionally incorrectly return 0. Signed-off-by: Michael Welling <mwelling@ieee.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/mcp320x.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c
index efbfd12a4bfd..8d9c9b9215dd 100644
--- a/drivers/iio/adc/mcp320x.c
+++ b/drivers/iio/adc/mcp320x.c
@@ -60,12 +60,12 @@ struct mcp320x {
struct spi_message msg;
struct spi_transfer transfer[2];
- u8 tx_buf;
- u8 rx_buf[2];
-
struct regulator *reg;
struct mutex lock;
const struct mcp320x_chip_info *chip_info;
+
+ u8 tx_buf ____cacheline_aligned;
+ u8 rx_buf[2];
};
static int mcp320x_channel_to_tx_data(int device_index,