From: Fabio Estevam Date: Fri, 3 Oct 2014 01:25:24 +0000 (-0300) Subject: iio: adc: vf610: Disable the regulator on error X-Git-Tag: v5.15~16669^2~446^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9da64c25ffefa60b969c64176098ae616219f759;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index ebb73f5..767e9b9 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) ret = clk_prepare_enable(info->clk); if (ret) - return ret; + goto disable_reg; vf610_adc_hw_init(info); return 0; + +disable_reg: + regulator_disable(info->vref); + return ret; } #endif