summaryrefslogtreecommitdiff
path: root/drivers/iio/kfifo_buf.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-10-15 09:30:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-10-15 19:20:55 +0100
commitcb6fbfa1387f47e5ef4ab2fac5ed71f3c1175f75 (patch)
treed6491a31ede7ec1e6253948b7d0d839d7f00b878 /drivers/iio/kfifo_buf.c
parent5b78e5138e6a636d00fea08514bfc5a2ff5dfb15 (diff)
iio:kfifo: Set update_needed to false after allocating a new buffer
update_needed is used to decide whether the kfifo buffer needs to be re-allocated. It is set to true whenever the size of the buffer is changed. It is never set to false though, causing the buffer to always be re-allocated. Setting update_needed to false after the new buffer has been allocated fixes the problem. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/kfifo_buf.c')
-rw-r--r--drivers/iio/kfifo_buf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
index d654f42e16aa..95c6fc81c2c7 100644
--- a/drivers/iio/kfifo_buf.c
+++ b/drivers/iio/kfifo_buf.c
@@ -38,6 +38,7 @@ static int iio_request_update_kfifo(struct iio_buffer *r)
kfifo_free(&buf->kf);
ret = __iio_allocate_kfifo(buf, buf->buffer.bytes_per_datum,
buf->buffer.length);
+ buf->update_needed = false;
} else {
kfifo_reset_out(&buf->kf);
}