diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-10-02 21:25:24 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-10-04 07:30:26 -0400 |
commit | 9da64c25ffefa60b969c64176098ae616219f759 (patch) | |
tree | bcc82c4c2b4f495c7e4cda15d46ad52fa1687b6a /drivers/iio | |
parent | 2e3d6675dc2f402d8b799b773324e60af3e2a325 (diff) |
iio: adc: vf610: Disable the regulator on error
If clk_prepare_enable() fails we should disable the regulator that was
previously enabled.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/vf610_adc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index ebb73f5d3c3a..767e9b975f00 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c | |||
@@ -704,11 +704,15 @@ static int vf610_adc_resume(struct device *dev) | |||
704 | 704 | ||
705 | ret = clk_prepare_enable(info->clk); | 705 | ret = clk_prepare_enable(info->clk); |
706 | if (ret) | 706 | if (ret) |
707 | return ret; | 707 | goto disable_reg; |
708 | 708 | ||
709 | vf610_adc_hw_init(info); | 709 | vf610_adc_hw_init(info); |
710 | 710 | ||
711 | return 0; | 711 | return 0; |
712 | |||
713 | disable_reg: | ||
714 | regulator_disable(info->vref); | ||
715 | return ret; | ||
712 | } | 716 | } |
713 | #endif | 717 | #endif |
714 | 718 | ||