Skip to content

Commit

Permalink
USB: OTG: msm: Free VCCCX regulator even if we can't set the voltage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Greg Kroah-Hartman committed May 17, 2011
1 parent 7b521fc commit e99c430
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/otg/msm_otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit e99c430

Please sign in to comment.