summaryrefslogtreecommitdiff
path: root/drivers/iio/light
diff options
context:
space:
mode:
authorNuno Sa <nuno.sa@analog.com>2024-07-18 16:38:01 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-03 12:13:40 +0300
commit72c399838b2e9fed9856ee9c52375f628310dab9 (patch)
tree4b3c5435fadb7aaa7880f043b9c1e403da1bc1c6 /drivers/iio/light
parent4ab4d09e871746411e05e67e6cedd029c3b0083c (diff)
downloadlinux-72c399838b2e9fed9856ee9c52375f628310dab9.tar.xz
iio: light: si1145: use new '.masklength' accessors
Make use of iio_get_masklength) and iio_for_each_active_channel() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/si1145.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/iio/light/si1145.c b/drivers/iio/light/si1145.c
index 77666b780a5c..66abda021696 100644
--- a/drivers/iio/light/si1145.c
+++ b/drivers/iio/light/si1145.c
@@ -465,11 +465,10 @@ static irqreturn_t si1145_trigger_handler(int irq, void *private)
goto done;
}
- for_each_set_bit(i, indio_dev->active_scan_mask,
- indio_dev->masklength) {
+ iio_for_each_active_channel(indio_dev, i) {
int run = 1;
- while (i + run < indio_dev->masklength) {
+ while (i + run < iio_get_masklength(indio_dev)) {
if (!test_bit(i + run, indio_dev->active_scan_mask))
break;
if (indio_dev->channels[i + run].address !=
@@ -514,7 +513,7 @@ static int si1145_set_chlist(struct iio_dev *indio_dev, unsigned long scan_mask)
if (data->scan_mask == scan_mask)
return 0;
- for_each_set_bit(i, &scan_mask, indio_dev->masklength) {
+ for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) {
switch (indio_dev->channels[i].address) {
case SI1145_REG_ALSVIS_DATA:
reg |= SI1145_CHLIST_EN_ALSVIS;