]> git.baikalelectronics.ru Git - kernel.git/commit
iio: imu: st_lsm6dsx: Limit requested watermark value to hwfifo size
authorPaul Cercueil <paul@crapouillou.net>
Mon, 17 Jan 2022 10:25:11 +0000 (10:25 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 15 Jun 2022 21:07:09 +0000 (22:07 +0100)
commit1f97c6ee6c51c0bd606506fcb98b89105fdc5a2f
tree61ff1206beb73f77e68a1ef057ce98ba3ed14ac5
parent33251b9d1ee2b8b0679be8e0fab8b5311bc91438
iio: imu: st_lsm6dsx: 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: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/20220117102512.31725-1-paul@crapouillou.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c