summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/twl4030-madc.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 09:11:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 09:11:09 +0200
commit4fcae770f3027abefd952c5d511ac6299828865a (patch)
tree6cf64399a20f989358831a8f9b2ac2bb19628f54 /drivers/iio/adc/twl4030-madc.c
parent2847d242a1e48ca734cee742efa0f70abf545d1e (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
downloadtalos-op-linux-4fcae770f3027abefd952c5d511ac6299828865a.tar.gz
talos-op-linux-4fcae770f3027abefd952c5d511ac6299828865a.zip
Merge 4.14-rc4 into usb-next
This merges in the USB fixes that we need here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/adc/twl4030-madc.c')
-rw-r--r--drivers/iio/adc/twl4030-madc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 1edd99f0c5e5..e3cfb91bffc6 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -887,21 +887,27 @@ static int twl4030_madc_probe(struct platform_device *pdev)
/* Enable 3v1 bias regulator for MADC[3:6] */
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
- if (IS_ERR(madc->usb3v1))
- return -ENODEV;
+ if (IS_ERR(madc->usb3v1)) {
+ ret = -ENODEV;
+ goto err_i2c;
+ }
ret = regulator_enable(madc->usb3v1);
- if (ret)
+ if (ret) {
dev_err(madc->dev, "could not enable 3v1 bias regulator\n");
+ goto err_i2c;
+ }
ret = iio_device_register(iio_dev);
if (ret) {
dev_err(&pdev->dev, "could not register iio device\n");
- goto err_i2c;
+ goto err_usb3v1;
}
return 0;
+err_usb3v1:
+ regulator_disable(madc->usb3v1);
err_i2c:
twl4030_madc_set_current_generator(madc, 0, 0);
err_current_generator:
OpenPOWER on IntegriCloud