[PATCH 3/4] iio: adc: stm32-dfsdm: use resolution define

Olivier Moysan
2020-02-04T10:11:04Z

Use resolution define instead of hard coded value.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
---
drivers/iio/adc/stm32-dfsdm-adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 2aad2cda6943..07b9dfdf8e76 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -1440,7 +1440,7 @@ static int stm32_dfsdm_adc_chan_init_one(struct iio_dev *indio_dev,
ch->scan_type.shift = 8;
}
ch->scan_type.sign = 's';
- ch->scan_type.realbits = 24;
+ ch->scan_type.realbits = DFSDM_DATA_RES;
ch->scan_type.storagebits = 32;

return stm32_dfsdm_chan_configure(adc->dfsdm,
--
2.17.1