Merge tag 'iio-for-4.18a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[linux-block.git] / drivers / iio / adc / meson_saradc.c
index a5d481a2b4efa1841d024b865df618a3eaf83e95..2948909f3ee3117b31bcdec6421990f55c7344ba 100644 (file)
@@ -466,8 +466,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) {
+                       mutex_unlock(&indio_dev->mlock);
                        return -ETIMEDOUT;
+               }
        }
 
        return 0;