iio: tcs3414: fix iio_triggered_buffer_{pre,post}enable positions
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Fri, 20 Sep 2019 07:57:23 +0000 (10:57 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Sep 2019 15:31:38 +0000 (16:31 +0100)
commit0fe2f2b789190661df24bb8bf62294145729a1fe
tree9fa8d99e84ec994b9ed1f9aa80a010084f0dd4f0
parent505ea3ada665c466d0064b11b6e611b7f995517d
iio: tcs3414: fix iio_triggered_buffer_{pre,post}enable positions

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.

For the predisable hook, the disable code should occur before detaching
the poll func, and for the postenable hook, the poll func should be
attached before the enable code.

The driver was slightly reworked. The preenable hook was moved to the
postenable, to add some symmetry to the postenable/predisable part.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/tcs3414.c