From: Michael Welling Date: Wed, 6 May 2015 16:49:17 +0000 (-0500) Subject: iio: mcp320x: Fix occasional incorrect readings X-Git-Tag: v5.15~15766^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e81bc99a0826db4cd2d6ba9a982579b1467a79f;p=platform%2Fkernel%2Flinux-starfive.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 efbfd12..8d9c9b9 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,