iio: accel: adxl367: do not update FIFO watermark on scan mode update
authorCosmin Tanislav <demonsingur@gmail.com>
Sat, 14 May 2022 18:20:10 +0000 (21:20 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Jun 2022 13:35:27 +0000 (14:35 +0100)
commit0bd0bb1fc1e4430dff6856b59ddd63c72780d9be
tree2ba4c300d2f462535f2a6aea251a830dd0a19dee
parentd04d46dd82ad10bdc3c9ce6a513e1fa1336719c4
iio: accel: adxl367: do not update FIFO watermark on scan mode update

Currently, the driver updates the FIFO watermark inside both
update_scan_mode() and hwfifo_set_watermark(). Inside the IIO core,
hwfifo_set_watermark() is called immediately after update_scan_mode(),
making the first call to set_fifo_samples() redundant.

Remove the first call to set_fifo_samples(), and merge the
set_fifo_samples() function into the set_fifo_watermark()
function. Also, since fifo_set_size is always set inside of
update_scan_mode(), and it cannot be set to 0, remove the
zero check from set_fifo_samples().

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220514182010.152784-1-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl367.c