diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-15 12:55:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-17 14:20:23 -0400 |
commit | e99c4309fb064604a957d9c1a8d2d4a9ff19cf5e (patch) | |
tree | e171895f35ec73bd77f0093f8808440548838fee | |
parent | 7b521fcb6bf63a49bb7712d922dd1dd0a90a93cf (diff) |
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/otg/msm_otg.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index db69b2ac9264..b276f8fcdeba 100644 --- a/drivers/usb/otg/msm_otg.c +++ b/drivers/usb/otg/msm_otg.c | |||
@@ -93,11 +93,9 @@ static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init) | |||
93 | } else { | 93 | } else { |
94 | ret = regulator_set_voltage(hsusb_vddcx, 0, | 94 | ret = regulator_set_voltage(hsusb_vddcx, 0, |
95 | USB_PHY_VDD_DIG_VOL_MAX); | 95 | USB_PHY_VDD_DIG_VOL_MAX); |
96 | if (ret) { | 96 | if (ret) |
97 | dev_err(motg->otg.dev, "unable to set the voltage " | 97 | dev_err(motg->otg.dev, "unable to set the voltage " |
98 | "for hsusb vddcx\n"); | 98 | "for hsusb vddcx\n"); |
99 | return ret; | ||
100 | } | ||
101 | ret = regulator_disable(hsusb_vddcx); | 99 | ret = regulator_disable(hsusb_vddcx); |
102 | if (ret) | 100 | if (ret) |
103 | dev_err(motg->otg.dev, "unable to disable hsusb vddcx\n"); | 101 | dev_err(motg->otg.dev, "unable to disable hsusb vddcx\n"); |