iio: dln2-adc: fix iio_triggered_buffer_postenable() position
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 23 Oct 2019 08:26:34 +0000 (11:26 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 2 Nov 2019 14:36:33 +0000 (14:36 +0000)
commita7bddfe2dfce1d8859422124abe1964e0ecd386e
tree28d123087bb65e22e8f4ebde626370e31b930ff0
parentf8be8d1ede50a5918faeda82e1f1fb45e9431b54
iio: dln2-adc: fix iio_triggered_buffer_postenable() position

The iio_triggered_buffer_postenable() hook should be called first to
attach the poll function. The iio_triggered_buffer_predisable() hook is
called last (as is it should).

This change moves iio_triggered_buffer_postenable() to be called first. It
adds iio_triggered_buffer_predisable() on the error paths of the postenable
hook.
For the predisable hook, some code-paths have been changed to make sure
that the iio_triggered_buffer_predisable() hook gets called in case there
is an error before it.

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