Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: ti-ads8688: Update buffer allocation for timestamps

Per Jonathan Cameron, the buffer needs to allocate room for a
64 bit timestamp as well as the channels. Change the buffer
to allocate this additional space.

Fixes: 2a86487786b5c ("iio: adc: ti-ads8688: add trigger and buffer support")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Dan Murphy and committed by
Jonathan Cameron
f214ff52 b119d3bc

+2 -1
+2 -1
drivers/iio/adc/ti-ads8688.c
··· 41 41 42 42 #define ADS8688_VREF_MV 4096 43 43 #define ADS8688_REALBITS 16 44 + #define ADS8688_MAX_CHANNELS 8 44 45 45 46 /* 46 47 * enum ads8688_range - ADS8688 reference voltage range ··· 386 385 { 387 386 struct iio_poll_func *pf = p; 388 387 struct iio_dev *indio_dev = pf->indio_dev; 389 - u16 buffer[8]; 388 + u16 buffer[ADS8688_MAX_CHANNELS + sizeof(s64)/sizeof(u16)]; 390 389 int i, j = 0; 391 390 392 391 for (i = 0; i < indio_dev->masklength; i++) {