Commit 72c39983 authored by Nuno Sa's avatar Nuno Sa Committed by Jonathan Cameron

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: default avatarNuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 4ab4d09e
...@@ -465,11 +465,10 @@ static irqreturn_t si1145_trigger_handler(int irq, void *private) ...@@ -465,11 +465,10 @@ static irqreturn_t si1145_trigger_handler(int irq, void *private)
goto done; goto done;
} }
for_each_set_bit(i, indio_dev->active_scan_mask, iio_for_each_active_channel(indio_dev, i) {
indio_dev->masklength) {
int run = 1; 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)) if (!test_bit(i + run, indio_dev->active_scan_mask))
break; break;
if (indio_dev->channels[i + run].address != 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) ...@@ -514,7 +513,7 @@ static int si1145_set_chlist(struct iio_dev *indio_dev, unsigned long scan_mask)
if (data->scan_mask == scan_mask) if (data->scan_mask == scan_mask)
return 0; 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) { switch (indio_dev->channels[i].address) {
case SI1145_REG_ALSVIS_DATA: case SI1145_REG_ALSVIS_DATA:
reg |= SI1145_CHLIST_EN_ALSVIS; reg |= SI1145_CHLIST_EN_ALSVIS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment