From e99c4309fb064604a957d9c1a8d2d4a9ff19cf5e Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sun, 15 May 2011 09:55:58 -0700 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/otg/msm_otg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/usb/otg') diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index db69b2ac926..b276f8fcdeb 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) } 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"); -- cgit v1.2.3-70-g09d2