diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2019-09-20 09:31:22 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-10-13 09:53:34 +0200 |
commit | 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 (patch) | |
tree | abe3f1d1d1ece35d93048d2ab50e5a70fee4698e /drivers/iio/chemical | |
parent | iio: gyro: clean up indentation issue (diff) | |
download | linux-0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08.tar.xz linux-0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08.zip |
iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position
The iio_triggered_buffer_{predisable,postenable} functions attach/detach
the poll functions.
The iio_triggered_buffer_predisable() should be called last, to detach the
poll func after the devices has been suspended.
The position of iio_triggered_buffer_postenable() is correct.
Note this is not stable material. It's a fix in the logical
model rather fixing an actual bug. These are being tidied up
throughout the subsystem to allow more substantial rework that
was blocked by variations in how things were done.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/chemical')
-rw-r--r-- | drivers/iio/chemical/atlas-ph-sensor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c index 3a20cb5d9bff..6c175eb1c7a7 100644 --- a/drivers/iio/chemical/atlas-ph-sensor.c +++ b/drivers/iio/chemical/atlas-ph-sensor.c @@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev) struct atlas_data *data = iio_priv(indio_dev); int ret; - ret = iio_triggered_buffer_predisable(indio_dev); + ret = atlas_set_interrupt(data, false); if (ret) return ret; - ret = atlas_set_interrupt(data, false); + pm_runtime_mark_last_busy(&data->client->dev); + ret = pm_runtime_put_autosuspend(&data->client->dev); if (ret) return ret; - pm_runtime_mark_last_busy(&data->client->dev); - return pm_runtime_put_autosuspend(&data->client->dev); + return iio_triggered_buffer_predisable(indio_dev); } static const struct iio_trigger_ops atlas_interrupt_trigger_ops = { |