From: Michael Welling Date: Wed, 6 May 2015 16:49:17 +0000 (-0500) Subject: iio: mcp320x: Fix occasional incorrect readings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e81bc99a0826db4cd2d6ba9a982579b1467a79f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iio: mcp320x: Fix occasional incorrect readings Without the cacheline alignment, the readings will occasionally incorrectly return 0. Signed-off-by: Michael Welling Signed-off-by: Jonathan Cameron --- 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,