iio: adc: stm32: fix stm32h7_adc_enable error handling
authorFabrice Gasnier <fabrice.gasnier@st.com>
Tue, 23 Jan 2018 16:04:56 +0000 (17:04 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Jan 2018 08:18:49 +0000 (08:18 +0000)
commita3b5655ebdb501a98a45c0d3265dca9f2fe0218a
treec2e24da39c7b99abb204770eabfc0555b2c513a8
parente31b617d0a63c6558485aaa730fd162faa95a766
iio: adc: stm32: fix stm32h7_adc_enable error handling

Error handling in stm32h7_adc_enable routine doesn't unwind enable
sequence correctly. ADEN can only be cleared by hardware (e.g. by
writing one to ADDIS).
It's also better to clear ADRDY just after it's been set by hardware.

Fixes: 95e339b6e85d ("iio: adc: stm32: add support for STM32H7")

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc.c