summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-26 17:55:10 (GMT)
committerJonathan Cameron <jic23@kernel.org>2014-12-12 12:28:30 (GMT)
commit131e97d3faf2df29a6a488b94890481351f18aea (patch)
treeef714567c14b5b864f3a56fd5b71b67548ee19d9 /drivers/staging/iio/accel
parent217a5cf0a1100264ced523e437e2e22c442dca7c (diff)
downloadlinux-131e97d3faf2df29a6a488b94890481351f18aea.tar.xz
staging:iio:sca3000: Register same channels for device and buffer
In preparation for moving the buffer registration to the core make sure to register the same channel array for the device and the buffer. Currently the temperature channel is not registered for the buffer, setting its scan index to -1 will make sure that it is skipped for the buffer. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r--drivers/staging/iio/accel/sca3000_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index cd46a61..aef8c91 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -459,6 +459,8 @@ static const struct iio_chan_spec sca3000_channels_with_temp[] = {
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OFFSET),
+ /* No buffer support */
+ .scan_index = -1,
},
};
@@ -1154,9 +1156,8 @@ static int sca3000_probe(struct spi_device *spi)
if (ret < 0)
return ret;
- ret = iio_buffer_register(indio_dev,
- sca3000_channels,
- ARRAY_SIZE(sca3000_channels));
+ ret = iio_buffer_register(indio_dev, indio_dev->channels,
+ indio_dev->num_channels);
if (ret < 0)
goto error_unregister_dev;