iio: adc: ti-ads8344: Fix channel selection
authorGregory CLEMENT <gregory.clement@bootlin.com>
Thu, 30 Apr 2020 13:05:47 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 15:46:46 +0000 (17:46 +0200)
commite64b205035fbde73ef0b858e7775242f8dd6c62d
treeabe69083fe694cff3841fec8443a5acfd831e351
parent9af65dc54b9be53bfe3f4112bcab1d27641ce443
iio: adc: ti-ads8344: Fix channel selection

commit bcfa1e253d2e329e1ebab5c89f3c73f6dd17606c upstream.

During initial submission the selection of the channel was done using
the scan_index member of the iio_chan_spec structure. It was an abuse
because this member is supposed to be used with a buffer so it was
removed.

However there was still the need to be able to known how to select a
channel, the correct member to store this information is address.

Thanks to this it is possible to select any other channel than the
channel 0.

Fixes: 8dd2d7c0fed7 ("iio: adc: Add driver for the TI ADS8344 A/DC chips")
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ti-ads8344.c