]> git.baikalelectronics.ru Git - kernel.git/commit
iio: buffer: fix attach/detach pollfunc order
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 15 Jul 2020 04:16:29 +0000 (07:16 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 15 Jul 2020 12:04:44 +0000 (13:04 +0100)
commit08791a74fb9383a19542a21b163acd7fa6e0b887
tree87b5787daa46a99307b11e101ef7d914865cfb0a
parent7072452e664477ed6dca69cebc0376a013bf395c
iio: buffer: fix attach/detach pollfunc order

The original patch was error-ed by the submitter (me) and not by the author
(Lars).
After looking through the discussion logs (on email), it seems that this
order was wrong for the start, even though the order implemented in the
drivers was correct.

Discussions:
- first RFC: https://lore.kernel.org/linux-iio/20180622135322.3459-1-alexandru.ardelean@analog.com/
- 2nd patch: https://lore.kernel.org/linux-iio/20181219140912.22582-1-alexandru.ardelean@analog.com/
- final patch-sets:
  https://lore.kernel.org/linux-iio/20200522104632.517470-1-alexandru.ardelean@analog.com/
  https://lore.kernel.org/linux-iio/20200525113855.178821-1-alexandru.ardelean@analog.com/

The last one was applied.

The idea is that pollfunc should be attached before calling the
'indio_dev->setup_ops->postenable' hook and should be detached after
calling the 'indio_dev->setup_ops->predisable' hook.

While the drivers were updated to take this into account, the change to the
IIO core was somehow omitted and was made wrong.

This change fixes the order to the proper form.

Fixes ac7a441fbd3a8: ("iio: Move attach/detach of the poll func to the core")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-buffer.c