summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/iio_simple_dummy_buffer.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-26 18:55:11 +0100
committerJonathan Cameron <jic23@kernel.org>2014-12-12 12:28:30 +0000
commit4ae03019923f7dd5785b69a513b74ccc1c3f7766 (patch)
treeb7e0e5bb1f7bf139e5499c71dd6e054c52ebf645 /drivers/staging/iio/iio_simple_dummy_buffer.c
parent131e97d3faf2df29a6a488b94890481351f18aea (diff)
staging:iio:dummy: 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 output voltage and the activity channels are 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/iio_simple_dummy_buffer.c')
-rw-r--r--drivers/staging/iio/iio_simple_dummy_buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/iio_simple_dummy_buffer.c b/drivers/staging/iio/iio_simple_dummy_buffer.c
index fd74f9166a5f..35d60d5045dc 100644
--- a/drivers/staging/iio/iio_simple_dummy_buffer.c
+++ b/drivers/staging/iio/iio_simple_dummy_buffer.c
@@ -115,8 +115,7 @@ static const struct iio_buffer_setup_ops iio_simple_dummy_buffer_setup_ops = {
.predisable = &iio_triggered_buffer_predisable,
};
-int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev,
- const struct iio_chan_spec *channels, unsigned int num_channels)
+int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
{
int ret;
struct iio_buffer *buffer;
@@ -173,7 +172,8 @@ int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev,
*/
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
- ret = iio_buffer_register(indio_dev, channels, num_channels);
+ ret = iio_buffer_register(indio_dev, indio_dev->channels,
+ indio_dev->num_channels);
if (ret)
goto error_dealloc_pollfunc;