iio: potentiostat: lmp9100: fix iio_triggered_buffer_{predisable,postenable} positions
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 4 Mar 2020 09:41:05 +0000 (11:41 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 8 Mar 2020 17:28:53 +0000 (17:28 +0000)
commitd7cf5f60474cf591db771bc15e3b7320be5399e0
treeff4ff3603e2c9ef64884dca8c6c61707adaad5f4
parent736e19e684b3359b61740f3b75014c375c57bf9d
iio: potentiostat: lmp9100: fix iio_triggered_buffer_{predisable,postenable} 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 lmp9100 was attaching a poll function but never detaching it via any
IIO disable hook.

This change adds the detaching of the poll function, and moves/renames
lmp91000_buffer_preenable() function to lmp91000_buffer_postenable().
The idea is to make it more symmetrical, so that when the
iio_triggered_buffer_{predisable,postenable} functions get removed, it's
easier to see.

Fixes: 67e17300dc1d7 ("iio: potentiostat: add LMP91000 support")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/potentiostat/lmp91000.c