]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
commit003241bbe5e52f38bd4f55ff65586501c3e28dc7
treea2d91fb53c8a63645b361cba3fc5cbc4cff230a2
parentdb45308aebcb9808c1b565baa565fe24d440d019
iio: dln2-adc: fix iio_triggered_buffer_postenable() position

BugLink: https://bugs.launchpad.net/bugs/1859712
[ Upstream commit a7bddfe2dfce1d8859422124abe1964e0ecd386e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iio/adc/dln2-adc.c