1

iio: adc: dln2-adc: 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-2-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Nuno Sa 2024-07-18 15:37:48 +02:00 committed by Jonathan Cameron
parent 6d4e5ffb3c
commit b59776720f

View File

@ -108,7 +108,7 @@ static void dln2_adc_update_demux(struct dln2_adc *dln2)
dln2->demux_count = 0; dln2->demux_count = 0;
/* Optimize all 8-channels case */ /* Optimize all 8-channels case */
if (indio_dev->masklength && if (iio_get_masklength(indio_dev) &&
(*indio_dev->active_scan_mask & 0xff) == 0xff) { (*indio_dev->active_scan_mask & 0xff) == 0xff) {
dln2_adc_add_demux(dln2, 0, 0, 16); dln2_adc_add_demux(dln2, 0, 0, 16);
dln2->ts_pad_offset = 0; dln2->ts_pad_offset = 0;
@ -117,9 +117,7 @@ static void dln2_adc_update_demux(struct dln2_adc *dln2)
} }
/* Build demux table from fixed 8-channels to active_scan_mask */ /* Build demux table from fixed 8-channels to active_scan_mask */
for_each_set_bit(out_ind, iio_for_each_active_channel(indio_dev, out_ind) {
indio_dev->active_scan_mask,
indio_dev->masklength) {
/* Handle timestamp separately */ /* Handle timestamp separately */
if (out_ind == DLN2_ADC_MAX_CHANNELS) if (out_ind == DLN2_ADC_MAX_CHANNELS)
break; break;
@ -541,7 +539,7 @@ static int dln2_adc_triggered_buffer_postenable(struct iio_dev *indio_dev)
/* Assign trigger channel based on first enabled channel */ /* Assign trigger channel based on first enabled channel */
trigger_chan = find_first_bit(indio_dev->active_scan_mask, trigger_chan = find_first_bit(indio_dev->active_scan_mask,
indio_dev->masklength); iio_get_masklength(indio_dev));
if (trigger_chan < DLN2_ADC_MAX_CHANNELS) { if (trigger_chan < DLN2_ADC_MAX_CHANNELS) {
dln2->trigger_chan = trigger_chan; dln2->trigger_chan = trigger_chan;
ret = dln2_adc_set_chan_period(dln2, dln2->trigger_chan, ret = dln2_adc_set_chan_period(dln2, dln2->trigger_chan,