提交 e99c4309 编写于 作者: M Mark Brown 提交者: Greg Kroah-Hartman

USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage

If for some reason we fail to set the voltage range for the VDDCX regulator
when removing it's better to still disable and free the regulator as that
avoids leaking a reference to it and is likely to ensure that it's turned
off completely.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7b521fcb
......@@ -93,11 +93,9 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init)
} else {
ret = regulator_set_voltage(hsusb_vddcx, 0,
USB_PHY_VDD_DIG_VOL_MAX);
if (ret) {
if (ret)
dev_err(motg->otg.dev, "unable to set the voltage "
"for hsusb vddcx\n");
return ret;
}
ret = regulator_disable(hsusb_vddcx);
if (ret)
dev_err(motg->otg.dev, "unable to disable hsusb vddcx\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册