diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-11-30 10:58:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-30 19:46:33 -0500 |
commit | c3d6450e741da08c3bc2e2ba06d743c27540abac (patch) | |
tree | b7b7a08020ec99b45af4af601f40102cee4c1299 /drivers/usb/otg | |
parent | 02303f73373aa1da19dbec510ec5a4e2576f9610 (diff) |
usb: otg: twl4030-usb: Fix unbalanced regulator disables at module removal
Function twl4030_usb_remove can cause unbalanced regulator disables in
twl4030_phy_power if the cable is not connected. Regulator enable/disable
calls are in balance only if the twl4030_phy_resume was called prior the
twl4030_usb_remove, that is, the cable was connected.
Fix this by checking the 'asleep' variable in twl4030_usb_remove since that
variable is used to check state in other functions.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r-- | drivers/usb/otg/twl4030-usb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index d335f484fcd8..6ca505f333e4 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c | |||
@@ -678,7 +678,8 @@ static int __exit twl4030_usb_remove(struct platform_device *pdev) | |||
678 | /* disable complete OTG block */ | 678 | /* disable complete OTG block */ |
679 | twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB); | 679 | twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB); |
680 | 680 | ||
681 | twl4030_phy_power(twl, 0); | 681 | if (!twl->asleep) |
682 | twl4030_phy_power(twl, 0); | ||
682 | regulator_put(twl->usb1v5); | 683 | regulator_put(twl->usb1v5); |
683 | regulator_put(twl->usb1v8); | 684 | regulator_put(twl->usb1v8); |
684 | regulator_put(twl->usb3v1); | 685 | regulator_put(twl->usb3v1); |