Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: ad7606: don't use address field

Drop use of the address field in the ad7606 driver. This field was
duplicating the same info that was already in the channel and scan_index
fields. This is one less thing to have to hold in your mind when reading
the code.

Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250318-iio-adc-ad7606-improvements-v2-7-4b605427774c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
f504e352 050cf84f

+4 -5
+4 -4
drivers/iio/adc/ad7606.c
··· 776 776 case IIO_CHAN_INFO_RAW: 777 777 if (!iio_device_claim_direct(indio_dev)) 778 778 return -EBUSY; 779 - ret = ad7606_scan_direct(indio_dev, chan->address, val); 779 + ret = ad7606_scan_direct(indio_dev, chan->scan_index, val); 780 780 iio_device_release_direct(indio_dev); 781 781 if (ret < 0) 782 782 return ret; 783 783 return IIO_VAL_INT; 784 784 case IIO_CHAN_INFO_SCALE: 785 785 if (st->sw_mode_en) 786 - ch = chan->address; 786 + ch = chan->scan_index; 787 787 cs = &st->chan_scales[ch]; 788 788 *val = cs->scale_avail[cs->range][0]; 789 789 *val2 = cs->scale_avail[cs->range][1]; ··· 865 865 switch (mask) { 866 866 case IIO_CHAN_INFO_SCALE: 867 867 if (st->sw_mode_en) 868 - ch = chan->address; 868 + ch = chan->scan_index; 869 869 cs = &st->chan_scales[ch]; 870 870 for (i = 0; i < cs->num_scales; i++) { 871 871 scale_avail_uv[i] = cs->scale_avail[i][0] * MICRO + ··· 1072 1072 1073 1073 case IIO_CHAN_INFO_SCALE: 1074 1074 if (st->sw_mode_en) 1075 - ch = chan->address; 1075 + ch = chan->scan_index; 1076 1076 1077 1077 cs = &st->chan_scales[ch]; 1078 1078 *vals = (int *)cs->scale_avail;
-1
drivers/iio/adc/ad7606.h
··· 45 45 .type = IIO_VOLTAGE, \ 46 46 .indexed = 1, \ 47 47 .channel = num, \ 48 - .address = num, \ 49 48 .info_mask_separate = mask_sep, \ 50 49 .info_mask_separate_available = \ 51 50 mask_sep_avail, \