Skip to content

Commit

Permalink
iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable()…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
Acked-by: Matt Ranostay <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
commodo authored and jic23 committed Oct 13, 2019
1 parent 4dbc54c commit 0c8a6e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/chemical/atlas-ph-sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 0c8a6e7

Please sign in to comment.