浏览代码

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>
Fabio Estevam 11 年之前
父节点
当前提交
9da64c25ff
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      drivers/iio/adc/vf610_adc.c

+ 5 - 1
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