lkml.org 
[lkml]   [2020]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 7/9] iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()
Date
This change switches to the new devm_iio_triggered_buffer_setup_ext()
function and removes the iio_buffer_set_attrs() call, for assigning the
HW FIFO attributes to the buffer.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
.../common/cros_ec_sensors/cros_ec_sensors_core.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index c62cacc04672..1eafcf04ad69 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -353,19 +353,22 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
if (ret)
return ret;
} else {
+ const struct attribute **fifo_attrs;
+
+ if (has_hw_fifo)
+ fifo_attrs = cros_ec_sensor_fifo_attributes;
+ else
+ fifo_attrs = NULL;
+
/*
* The only way to get samples in buffer is to set a
* software trigger (systrig, hrtimer).
*/
- ret = devm_iio_triggered_buffer_setup(
+ ret = devm_iio_triggered_buffer_setup_ext(
dev, indio_dev, NULL, trigger_capture,
- NULL);
+ NULL, fifo_attrs);
if (ret)
return ret;
-
- if (has_hw_fifo)
- iio_buffer_set_attrs(indio_dev->buffer,
- cros_ec_sensor_fifo_attributes);
}
}

--
2.17.1
\
 
 \ /
  Last update: 2020-09-29 09:10    [W:0.077 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site