Skip to content

Commit 7f70be6

Browse files
tititiou36jic23
authored andcommitted
iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'
Commit 7cc97d7 has introduced a call to 'regulator_disable()' in the .remove function. So we should also have such a call in the .probe function in case of error after a successful 'regulator_enable()' call. Add a new label for that and use it. 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 245a396 commit 7f70be6

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
@@ -899,11 +899,13 @@ static int twl4030_madc_probe(struct platform_device *pdev)
899899
ret = iio_device_register(iio_dev);
900900
if (ret) {
901901
dev_err(&pdev->dev, "could not register iio device\n");
902-
goto err_i2c;
902+
goto err_usb3v1;
903903
}
904904

905905
return 0;
906906

907+
err_usb3v1:
908+
regulator_disable(madc->usb3v1);
907909
err_i2c:
908910
twl4030_madc_set_current_generator(madc, 0, 0);
909911
err_current_generator:

0 commit comments

Comments
 (0)