Skip to content

Commit 0bab541

Browse files
tititiou36gregkh
authored andcommitted
iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'
commit 7f70be6e4025db0551e6863e7eb9cca07122695c upstream. 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 <christophe.jaillet@wanadoo.fr> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0141f85 commit 0bab541

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/iio/adc/twl4030-madc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,13 @@ static int twl4030_madc_probe(struct platform_device *pdev)
878878
ret = iio_device_register(iio_dev);
879879
if (ret) {
880880
dev_err(&pdev->dev, "could not register iio device\n");
881-
goto err_i2c;
881+
goto err_usb3v1;
882882
}
883883

884884
return 0;
885885

886+
err_usb3v1:
887+
regulator_disable(madc->usb3v1);
886888
err_i2c:
887889
twl4030_madc_set_current_generator(madc, 0, 0);
888890
err_current_generator:

0 commit comments

Comments
 (0)