lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200929070908.10456-7-alexandru.ardelean@analog.com>
Date:   Tue, 29 Sep 2020 10:09:05 +0300
From:   Alexandru Ardelean <alexandru.ardelean@...log.com>
To:     <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <jic23@...nel.org>, <eugen.hristev@...rochip.com>,
        <nicolas.ferre@...rochip.com>, <ludovic.desroches@...rochip.com>,
        <bleung@...omium.org>, <enric.balletbo@...labora.com>,
        <groeck@...omium.org>, <srinivas.pandruvada@...ux.intel.com>,
        <andy.shevchenko@...il.com>, <gwendal@...omium.org>,
        Alexandru Ardelean <alexandru.ardelean@...log.com>
Subject: [PATCH v2 6/9] iio: adc: at91-sama5d2_adc: use devm_iio_triggered_buffer_setup_ext()

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@...log.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index b9c3cc6d5913..b012ce766f91 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1665,11 +1665,17 @@ static int at91_adc_buffer_and_trigger_init(struct device *dev,
 					    struct iio_dev *indio)
 {
 	struct at91_adc_state *st = iio_priv(indio);
+	const struct attribute **fifo_attrs;
 	int ret;
 
-	ret = devm_iio_triggered_buffer_setup(&indio->dev, indio,
+	if (st->selected_trig->hw_trig)
+		fifo_attrs = at91_adc_fifo_attributes;
+	else
+		fifo_attrs = NULL;
+
+	ret = devm_iio_triggered_buffer_setup_ext(&indio->dev, indio,
 		&iio_pollfunc_store_time,
-		&at91_adc_trigger_handler, &at91_buffer_setup_ops);
+		&at91_adc_trigger_handler, &at91_buffer_setup_ops, fifo_attrs);
 	if (ret < 0) {
 		dev_err(dev, "couldn't initialize the buffer.\n");
 		return ret;
@@ -1678,8 +1684,6 @@ static int at91_adc_buffer_and_trigger_init(struct device *dev,
 	if (!st->selected_trig->hw_trig)
 		return 0;
 
-	iio_buffer_set_attrs(indio->buffer, at91_adc_fifo_attributes);
-
 	st->trig = at91_adc_allocate_trigger(indio, st->selected_trig->name);
 	if (IS_ERR(st->trig)) {
 		dev_err(dev, "could not allocate trigger\n");
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ