[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250312-iio-adc-ad7606-improvements-v1-3-d1ec04847aea@baylibre.com>
Date: Wed, 12 Mar 2025 20:15:41 -0500
From: David Lechner <dlechner@...libre.com>
To: Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
Cc: Michael Hennerich <Michael.Hennerich@...log.com>,
Angelo Dureghello <adureghello@...libre.com>,
Alexandru Ardelean <aardelean@...libre.com>,
Beniamin Bia <beniamin.bia@...log.com>,
Stefan Popa <stefan.popa@...log.com>, linux-kernel@...r.kernel.org,
David Lechner <dlechner@...libre.com>
Subject: [PATCH 03/11] iio: adc: ad7606: fix scales_available attributes
Fix the scales_available attributes to return all of the scales, not
just 1/2 of them. Also fix const correctness in the cast while we are
touching this.
Fixes: 94aab7a0f5c7 ("iio: adc: ad7606: rework available attributes for SW channels")
Signed-off-by: David Lechner <dlechner@...libre.com>
---
drivers/iio/adc/ad7606.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index ec444aba25e89ced7b84b723aded3c9dbf2c738b..79929bd24fa40bccfcdd88673107da4bf56e032b 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -1064,8 +1064,8 @@ static int ad7606_read_avail(struct iio_dev *indio_dev,
ch = chan->address;
cs = &st->chan_scales[ch];
- *vals = (int *)cs->scale_avail;
- *length = cs->num_scales;
+ *vals = (const int *)cs->scale_avail;
+ *length = cs->num_scales * 2;
*type = IIO_VAL_INT_PLUS_MICRO;
return IIO_AVAIL_LIST;
--
2.43.0
Powered by blists - more mailing lists