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 <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
Fabio Estevam 2014-10-02 22:25:24 -03:00 • committed by Jonathan Cameron
commit 9da64c25ff

View file

@ -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