Skip to content

Commit 245a396

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/iio/adc/twl4030-madc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
887887

888888
/* Enable 3v1 bias regulator for MADC[3:6] */
889889
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
890-
if (IS_ERR(madc->usb3v1))
891-
return -ENODEV;
890+
if (IS_ERR(madc->usb3v1)) {
891+
ret = -ENODEV;
892+
goto err_i2c;
893+
}
892894

893895
ret = regulator_enable(madc->usb3v1);
894896
if (ret)

0 commit comments

Comments
 (0)