diff options
Diffstat (limited to 'drivers/usb/host/ehci-omap.c')
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 55a57c23dd0f..45240321ca09 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static void disable_put_regulator( | ||
102 | struct ehci_hcd_omap_platform_data *pdata) | ||
103 | { | ||
104 | int i; | ||
105 | |||
106 | for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) { | ||
107 | if (pdata->regulator[i]) { | ||
108 | regulator_disable(pdata->regulator[i]); | ||
109 | regulator_put(pdata->regulator[i]); | ||
110 | } | ||
111 | } | ||
112 | } | ||
101 | 113 | ||
102 | /* configure so an HC device and id are always provided */ | 114 | /* configure so an HC device and id are always provided */ |
103 | /* always called with process context; sleeping is OK */ | 115 | /* always called with process context; sleeping is OK */ |
@@ -231,9 +243,11 @@ err_add_hcd: | |||
231 | omap_usbhs_disable(dev); | 243 | omap_usbhs_disable(dev); |
232 | 244 | ||
233 | err_enable: | 245 | err_enable: |
246 | disable_put_regulator(pdata); | ||
234 | usb_put_hcd(hcd); | 247 | usb_put_hcd(hcd); |
235 | 248 | ||
236 | err_io: | 249 | err_io: |
250 | iounmap(regs); | ||
237 | return ret; | 251 | return ret; |
238 | } | 252 | } |
239 | 253 | ||
@@ -253,6 +267,8 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) | |||
253 | 267 | ||
254 | usb_remove_hcd(hcd); | 268 | usb_remove_hcd(hcd); |
255 | omap_usbhs_disable(dev); | 269 | omap_usbhs_disable(dev); |
270 | disable_put_regulator(dev->platform_data); | ||
271 | iounmap(hcd->regs); | ||
256 | usb_put_hcd(hcd); | 272 | usb_put_hcd(hcd); |
257 | return 0; | 273 | return 0; |
258 | } | 274 | } |