Commit e7fb17a3 authored by Nuno Sa's avatar Nuno Sa Committed by Jonathan Cameron

iio: adc: xilinx-xadc-core: 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/20240726-dev-iio-masklength-private3-v1-20-82913fc0fb87@analog.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent bc76efb6
...@@ -628,7 +628,7 @@ static int xadc_update_scan_mode(struct iio_dev *indio_dev, ...@@ -628,7 +628,7 @@ static int xadc_update_scan_mode(struct iio_dev *indio_dev,
size_t n; size_t n;
void *data; void *data;
n = bitmap_weight(mask, indio_dev->masklength); n = bitmap_weight(mask, iio_get_masklength(indio_dev));
data = devm_krealloc_array(indio_dev->dev.parent, xadc->data, data = devm_krealloc_array(indio_dev->dev.parent, xadc->data,
n, sizeof(*xadc->data), GFP_KERNEL); n, sizeof(*xadc->data), GFP_KERNEL);
...@@ -681,8 +681,7 @@ static irqreturn_t xadc_trigger_handler(int irq, void *p) ...@@ -681,8 +681,7 @@ static irqreturn_t xadc_trigger_handler(int irq, void *p)
goto out; goto out;
j = 0; j = 0;
for_each_set_bit(i, indio_dev->active_scan_mask, iio_for_each_active_channel(indio_dev, i) {
indio_dev->masklength) {
chan = xadc_scan_index_to_channel(i); chan = xadc_scan_index_to_channel(i);
xadc_read_adc_reg(xadc, chan, &xadc->data[j]); xadc_read_adc_reg(xadc, chan, &xadc->data[j]);
j++; j++;
......
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