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: 7cc97d77ee
("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>
This commit is contained in:
parent
4590ed795f
commit
0141f858d2
1 changed files with 4 additions and 2 deletions
|
@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* Enable 3v1 bias regulator for MADC[3:6] */
|
/* Enable 3v1 bias regulator for MADC[3:6] */
|
||||||
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
|
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
|
||||||
if (IS_ERR(madc->usb3v1))
|
if (IS_ERR(madc->usb3v1)) {
|
||||||
return -ENODEV;
|
ret = -ENODEV;
|
||||||
|
goto err_i2c;
|
||||||
|
}
|
||||||
|
|
||||||
ret = regulator_enable(madc->usb3v1);
|
ret = regulator_enable(madc->usb3v1);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Add table
Reference in a new issue