summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ina2xx-adc.c
diff options
context:
space:
mode:
authorStefan Brüns <stefan.bruens@rwth-aachen.de>2017-12-08 18:41:47 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-08 16:03:42 +0100
commitd456d61f53ece55ae17599bf004bb071c0a618e4 (patch)
tree84a39bdd9c3a7a1f354b91f39bac56f50e869e46 /drivers/iio/adc/ina2xx-adc.c
parent17b3453f5c69758e851a37776798e64795897a7d (diff)
downloadblackbird-obmc-linux-d456d61f53ece55ae17599bf004bb071c0a618e4.tar.gz
blackbird-obmc-linux-d456d61f53ece55ae17599bf004bb071c0a618e4.zip
iio: adc: ina2xx: Clarify size requirement for data buffer
The timestamp is inserted into the buffer after the sample data by iio_push_to_buffers_with_timestamp, document the space requirement for the timestamp. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc/ina2xx-adc.c')
-rw-r--r--drivers/iio/adc/ina2xx-adc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c
index 3195f8754c3b..8c8120406f52 100644
--- a/drivers/iio/adc/ina2xx-adc.c
+++ b/drivers/iio/adc/ina2xx-adc.c
@@ -700,7 +700,8 @@ static const struct iio_chan_spec ina219_channels[] = {
static int ina2xx_work_buffer(struct iio_dev *indio_dev)
{
struct ina2xx_chip_info *chip = iio_priv(indio_dev);
- unsigned short data[8];
+ /* data buffer needs space for channel data and timestap */
+ unsigned short data[4 + sizeof(s64)/sizeof(short)];
int bit, ret, i = 0;
s64 time_a, time_b;
unsigned int alert;
OpenPOWER on IntegriCloud