summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/ti-adc128s052.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc/ti-adc128s052.c')
-rw-r--r--drivers/iio/adc/ti-adc128s052.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
index ff6f7f63c8d9..27b8de41e34a 100644
--- a/drivers/iio/adc/ti-adc128s052.c
+++ b/drivers/iio/adc/ti-adc128s052.c
@@ -159,7 +159,13 @@ static int adc128_probe(struct spi_device *spi)
mutex_init(&adc->lock);
ret = iio_device_register(indio_dev);
+ if (ret)
+ goto err_disable_regulator;
+ return 0;
+
+err_disable_regulator:
+ regulator_disable(adc->reg);
return ret;
}