mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
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>
This commit is contained in:
parent
2e3d6675dc
commit
9da64c25ff
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue