diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-09-23 02:06:18 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2017-09-24 07:57:32 -0400 |
commit | 245a396a9b1a67ac5c3228737c261b3e48708a2a (patch) | |
tree | 66c5a1c880e6837893d2caeed005d83fcf5c35f9 | |
parent | c65e3d6ef4bfdc4c8460509f08507cf7dc026974 (diff) |
iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
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>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-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 bd3d37fc2144..252f5890311e 100644 --- a/drivers/iio/adc/twl4030-madc.c +++ b/drivers/iio/adc/twl4030-madc.c | |||
@@ -887,8 +887,10 @@ static int twl4030_madc_probe(struct platform_device *pdev) | |||
887 | 887 | ||
888 | /* Enable 3v1 bias regulator for MADC[3:6] */ | 888 | /* Enable 3v1 bias regulator for MADC[3:6] */ |
889 | madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); | 889 | madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); |
890 | if (IS_ERR(madc->usb3v1)) | 890 | if (IS_ERR(madc->usb3v1)) { |
891 | return -ENODEV; | 891 | ret = -ENODEV; |
892 | goto err_i2c; | ||
893 | } | ||
892 | 894 | ||
893 | ret = regulator_enable(madc->usb3v1); | 895 | ret = regulator_enable(madc->usb3v1); |
894 | if (ret) | 896 | if (ret) |