summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel/sca3000_ring.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-26 18:55:17 +0100
committerJonathan Cameron <jic23@kernel.org>2014-12-12 12:28:34 +0000
commit374956600ecbedf5ca29c76bde114160eb805091 (patch)
tree2276389687295dfa2d3704795e6b8a6b1b52257b /drivers/staging/iio/accel/sca3000_ring.c
parent8d92db2827b68206f6930e79132243416183e083 (diff)
iio: buffer: Drop get_length callback
We already do have the length field in the struct iio_buffer which is expected to be in sync with the current size of the buffer. And currently all implementations of the get_length callback either return this field or a constant number. This patch removes the get_length callback and replaces all occurrences in the IIO core with directly accessing the length field of 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/sca3000_ring.c')
-rw-r--r--drivers/staging/iio/accel/sca3000_ring.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c
index f2f260e01550..f76a26885808 100644
--- a/drivers/staging/iio/accel/sca3000_ring.c
+++ b/drivers/staging/iio/accel/sca3000_ring.c
@@ -129,12 +129,6 @@ error_ret:
return ret ? ret : num_read;
}
-/* This is only valid with all 3 elements enabled */
-static int sca3000_ring_get_length(struct iio_buffer *r)
-{
- return 64;
-}
-
static bool sca3000_ring_buf_data_available(struct iio_buffer *r)
{
return r->stufftoread;
@@ -248,6 +242,7 @@ static struct iio_buffer *sca3000_rb_allocate(struct iio_dev *indio_dev)
ring->private = indio_dev;
buf = &ring->buf;
buf->stufftoread = 0;
+ buf->length = 64;
buf->attrs = sca3000_ring_attributes;
iio_buffer_init(buf);
@@ -261,7 +256,6 @@ static void sca3000_ring_release(struct iio_buffer *r)
static const struct iio_buffer_access_funcs sca3000_ring_access_funcs = {
.read_first_n = &sca3000_read_first_n_hw_rb,
- .get_length = &sca3000_ring_get_length,
.data_available = sca3000_ring_buf_data_available,
.release = sca3000_ring_release,
};