iio: adc: stm32-dfsdm: fix multiple channel initialization
authorFabrice Gasnier <fabrice.gasnier@st.com>
Fri, 23 Feb 2018 12:50:58 +0000 (13:50 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 24 Feb 2018 13:00:54 +0000 (13:00 +0000)
commit0645af1b6988467b8362aaf44fb4013abb045bee
treeae19b64e6360b6520a73c20a20aff6030506cdb9
parent179858efd94f49945d41919c1d09a8e17c2afa98
iio: adc: stm32-dfsdm: fix multiple channel initialization

When several channels are registered (e.g. via st,adc-channels property):
- channels array is wrongly filled in. Only 1st element in array is being
  initialized with last registered channel.
  Fix it by passing reference to relevant channel (e.g. array[index]).
- only last initialized channel can work properly (e.g. unique 'ch_id'
  is used). Converting any other channel result in conversion timeout.
  Fix it by getting rid of 'ch_id', use chan->channel instead.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-dfsdm-adc.c