Commit 0c8a6e72 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron

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: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: default avatarMatt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 4dbc54c5
...@@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev) ...@@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev)
struct atlas_data *data = iio_priv(indio_dev); struct atlas_data *data = iio_priv(indio_dev);
int ret; int ret;
ret = iio_triggered_buffer_predisable(indio_dev); ret = atlas_set_interrupt(data, false);
if (ret) if (ret)
return 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) if (ret)
return ret; return ret;
pm_runtime_mark_last_busy(&data->client->dev); return iio_triggered_buffer_predisable(indio_dev);
return pm_runtime_put_autosuspend(&data->client->dev);
} }
static const struct iio_trigger_ops atlas_interrupt_trigger_ops = { static const struct iio_trigger_ops atlas_interrupt_trigger_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment