Skip to content

Commit

Permalink
iio: adc: vf610: Disable the regulator on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabio Estevam authored and Jonathan Cameron committed Oct 4, 2014
1 parent 2e3d667 commit 9da64c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/iio/adc/vf610_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9da64c2

Please sign in to comment.