Skip to content

Commit

Permalink
iio: mcp320x: Fix occasional incorrect readings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Welling authored and Jonathan Cameron committed May 7, 2015
1 parent 1d93353 commit 0e81bc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/iio/adc/mcp320x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0e81bc9

Please sign in to comment.