]> git.baikalelectronics.ru Git - kernel.git/commit
iio: fix config watermark initial value
authorIrina Tirdea <irina.tirdea@intel.com>
Thu, 24 Mar 2016 09:09:45 +0000 (11:09 +0200)
committerJonathan Cameron <jic23@kernel.org>
Mon, 28 Mar 2016 10:00:38 +0000 (11:00 +0100)
commit7346802d5549fecb10c3278c1a1b17a9aaa8dde9
treeee078e95414d0ba2448085213c05972aabd83f92
parent1744398497da844575911722ce6d7d2dd6b13ece
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: 68854b4eac3b ("iio: Set device watermark based on watermark of all
attached buffers")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-buffer.c