aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-09-23 02:06:20 -0400
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-09-24 08:04:07 -0400
commit53063846affd27def6f96e13a9fb80b9a3c2d126 (patch)
treeef3014161e191694f215b2b4c5cf88abcfa7cb04
parent7f70be6e4025db0551e6863e7eb9cca07122695c (diff)
iio: adc: twl4030: Return an error if we can not enable the vusb3v1 regulator in 'twl4030_madc_probe()'
If we can not enable the regulator, go through the error handling path instead of silently continuing. Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/twl4030-madc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 0c86fbb3033e..28df096e84ec 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -893,8 +893,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
893 } 893 }
894 894
895 ret = regulator_enable(madc->usb3v1); 895 ret = regulator_enable(madc->usb3v1);
896 if (ret) 896 if (ret) {
897 dev_err(madc->dev, "could not enable 3v1 bias regulator\n"); 897 dev_err(madc->dev, "could not enable 3v1 bias regulator\n");
898 goto err_i2c;
899 }
898 900
899 ret = iio_device_register(iio_dev); 901 ret = iio_device_register(iio_dev);
900 if (ret) { 902 if (ret) {