Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9da64c25 authored by Fabio Estevam's avatar Fabio Estevam Committed by Jonathan Cameron
Browse files

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: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 2e3d6675
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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