aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Welling <mwelling@ieee.org>2015-05-06 12:49:17 -0400
committerJonathan Cameron <jic23@kernel.org>2015-05-07 06:12:20 -0400
commit0e81bc99a0826db4cd2d6ba9a982579b1467a79f (patch)
treead5c9125446f561812810fd542850fba23aad2b3
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>
-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 {
60 struct spi_message msg; 60 struct spi_message msg;
61 struct spi_transfer transfer[2]; 61 struct spi_transfer transfer[2];
62 62
63 u8 tx_buf;
64 u8 rx_buf[2];
65
66 struct regulator *reg; 63 struct regulator *reg;
67 struct mutex lock; 64 struct mutex lock;
68 const struct mcp320x_chip_info *chip_info; 65 const struct mcp320x_chip_info *chip_info;
66
67 u8 tx_buf ____cacheline_aligned;
68 u8 rx_buf[2];
69}; 69};
70 70
71static int mcp320x_channel_to_tx_data(int device_index, 71static int mcp320x_channel_to_tx_data(int device_index,