Skip to content

Commit 5306384

Browse files
tititiou36jic23
authored andcommitted
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: 7cc97d7 ("iio: adc: twl4030: Fix ADC[3:6] readings") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 7f70be6 commit 5306384

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iio/adc/twl4030-madc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
893893
}
894894

895895
ret = regulator_enable(madc->usb3v1);
896-
if (ret)
896+
if (ret) {
897897
dev_err(madc->dev, "could not enable 3v1 bias regulator\n");
898+
goto err_i2c;
899+
}
898900

899901
ret = iio_device_register(iio_dev);
900902
if (ret) {

0 commit comments

Comments
 (0)