summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light/gp2ap020a00f.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2020-05-25 13:38:53 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-06-20 18:34:44 +0200
commitf11d59d87b8622d4cf9f856c0b8029fb030d8612 (patch)
tree249450dfe73731ab943e918cd5ed5ddd6c66c28b /drivers/iio/light/gp2ap020a00f.c
parentiio: at91_adc: remove usage of iio_priv_to_dev() helper (diff)
downloadlinux-f11d59d87b8622d4cf9f856c0b8029fb030d8612.tar.xz
linux-f11d59d87b8622d4cf9f856c0b8029fb030d8612.zip
iio: Move attach/detach of the poll func to the core
All devices using a triggered buffer need to attach and detach the trigger to the device in order to properly work. Instead of doing this in each and every driver by hand move this into the core. At this point in time, all drivers should have been resolved to attach/detach the poll-function in the same order. This patch removes all explicit calls of iio_triggered_buffer_postenable() & iio_triggered_buffer_predisable() in all drivers, since the core handles now the pollfunc attach/detach. The more peculiar change is for the 'at91-sama5d2_adc' driver, since it's not immediately obvious that removing the hooks doesn't break anything. Eugen was able to test on at91-sama5d2-adc driver, sama5d2-xplained board. All seems to be fine. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Tested-by: Eugen Hristev <eugen.hristev@microchip.com> #for at91-sama5d2-adc Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light/gp2ap020a00f.c')
-rw-r--r--drivers/iio/light/gp2ap020a00f.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c
index dd9ad880deca..e2850c1a7353 100644
--- a/drivers/iio/light/gp2ap020a00f.c
+++ b/drivers/iio/light/gp2ap020a00f.c
@@ -1390,12 +1390,6 @@ static int gp2ap020a00f_buffer_postenable(struct iio_dev *indio_dev)
mutex_lock(&data->lock);
- err = iio_triggered_buffer_postenable(indio_dev);
- if (err < 0) {
- mutex_unlock(&data->lock);
- return err;
- }
-
/*
* Enable triggers according to the scan_mask. Enabling either
* LIGHT_CLEAR or LIGHT_IR scan mode results in enabling ALS
@@ -1430,8 +1424,6 @@ static int gp2ap020a00f_buffer_postenable(struct iio_dev *indio_dev)
err = -ENOMEM;
error_unlock:
- if (err < 0)
- iio_triggered_buffer_predisable(indio_dev);
mutex_unlock(&data->lock);
return err;
@@ -1465,8 +1457,6 @@ static int gp2ap020a00f_buffer_predisable(struct iio_dev *indio_dev)
if (err == 0)
kfree(data->buffer);
- iio_triggered_buffer_predisable(indio_dev);
-
mutex_unlock(&data->lock);
return err;