Commit 6c1c6c91 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Thadeu Lima de Souza Cascardo

iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'

BugLink: http://bugs.launchpad.net/bugs/1724783

commit 245a396a 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: 7cc97d77 ("iio: adc: twl4030: Fix ADC[3:6] readings")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent eea5d7ff
...@@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct platform_device *pdev) ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment