Skip to content

Commit 1bef2c1

Browse files
itirdeajic23
authored andcommitted
iio: fix config watermark initial value
config structure is set to 0 when updating the buffers, so by default config->watermark will be 0. When computing the minimum between config->watermark and the buffer->watermark or insert_buffer-watermark, this will always be 0 regardless of the value set by the user for the buffer. Set as initial value for config->watermark the maximum allowed value so that the minimum value will always be set from one of the buffers. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Fixes: f0566c0 ("iio: Set device watermark based on watermark of all attached buffers") Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent b74fcca commit 1bef2c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/industrialio-buffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ static int iio_verify_update(struct iio_dev *indio_dev,
653653
unsigned int modes;
654654

655655
memset(config, 0, sizeof(*config));
656+
config->watermark = ~0;
656657

657658
/*
658659
* If there is just one buffer and we are removing it there is nothing

0 commit comments

Comments
 (0)