Commit 3c3e4b3a authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock()

The meson_sar_adc_lock() function is not supposed to hold the
"indio_dev->mlock" on the error path.

Fixes: 3adbf342 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs")
Signed-off-by: default avatarDan Carpenter <>
Cc: <>
Signed-off-by: default avatarJonathan Cameron <>
parent 6de2aeb5
......@@ -462,8 +462,10 @@ static int meson_sar_adc_lock(struct iio_dev *indio_dev)
regmap_read(priv->regmap, MESON_SAR_ADC_DELAY, &val);
} while (val & MESON_SAR_ADC_DELAY_BL30_BUSY && timeout--);
if (timeout < 0)
if (timeout < 0) {
return -ETIMEDOUT;
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment