]> git.baikalelectronics.ru Git - kernel.git/commit
iio: at91-sama5d2: Limit requested watermark value to hwfifo size
authorPaul Cercueil <paul@crapouillou.net>
Mon, 17 Jan 2022 10:25:12 +0000 (10:25 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 15 Jun 2022 21:07:10 +0000 (22:07 +0100)
commitbbb1d571d3885ed53f8c902902dcf4c6bb6d9af7
treef4f8a73e0033fb88c07be10775ca96bbb23ddfaf
parent1f97c6ee6c51c0bd606506fcb98b89105fdc5a2f
iio: at91-sama5d2: Limit requested watermark value to hwfifo size

Instead of returning an error if the watermark value is too high, which
the core will silently ignore anyway, limit the value to the hardware
FIFO size; a lower-than-requested value is still better than using the
default, which is usually 1.

Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220117102512.31725-2-paul@crapouillou.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c