diff options
author | Christophe JAILLET | 2017-09-23 01:06:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-10-12 04:27:34 -0500 |
commit | 0141f858d2e137a7de0bbb0fb4a9cfa3108774e8 (patch) | |
tree | c4d0199aabe9261035d9dd7c66bcdb9a7014d3a3 | |
parent | 4590ed795f0ccb1401d515eaa5864166032a4cfb (diff) | |
download | ti-linux-kernel-0141f858d2e137a7de0bbb0fb4a9cfa3108774e8.tar.gz ti-linux-kernel-0141f858d2e137a7de0bbb0fb4a9cfa3108774e8.tar.xz ti-linux-kernel-0141f858d2e137a7de0bbb0fb4a9cfa3108774e8.zip |
iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
commit 245a396a9b1a67ac5c3228737c261b3e48708a2a upstream.
If 'devm_regulator_get()' fails, we should go through the existing error
handling path instead of returning directly, as done is all the other
error handling paths in this function.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/iio/adc/twl4030-madc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c index 0c74869a540a..79028c95b673 100644 --- a/drivers/iio/adc/twl4030-madc.c +++ b/drivers/iio/adc/twl4030-madc.c | |||
@@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct platform_device *pdev) | |||
866 | 866 | ||
867 | /* Enable 3v1 bias regulator for MADC[3:6] */ | 867 | /* Enable 3v1 bias regulator for MADC[3:6] */ |
868 | madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); | 868 | madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); |
869 | if (IS_ERR(madc->usb3v1)) | 869 | if (IS_ERR(madc->usb3v1)) { |
870 | return -ENODEV; | 870 | ret = -ENODEV; |
871 | goto err_i2c; | ||
872 | } | ||
871 | 873 | ||
872 | ret = regulator_enable(madc->usb3v1); | 874 | ret = regulator_enable(madc->usb3v1); |
873 | if (ret) | 875 | if (ret) |