Commit d4aefec5 authored by Ming Lei's avatar Ming Lei Committed by Felipe Balbi

usb: host: ehci-omap: fix .remove and failure handling path of .probe(v1)

Obviously, disabling & put regulator and iounmap(hcd->regs)
are missed in .remove and failure handling path of .probe,
so add them.
Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Tested-by: default avatarKeshava Munegowda <Keshava_mgowda@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent c240d78a
...@@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port) ...@@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
} }
} }
static void disable_put_regulator(
struct ehci_hcd_omap_platform_data *pdata)
{
int i;
for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
if (pdata->regulator[i]) {
regulator_disable(pdata->regulator[i]);
regulator_put(pdata->regulator[i]);
}
}
}
/* configure so an HC device and id are always provided */ /* configure so an HC device and id are always provided */
/* always called with process context; sleeping is OK */ /* always called with process context; sleeping is OK */
...@@ -231,9 +243,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) ...@@ -231,9 +243,11 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
omap_usbhs_disable(dev); omap_usbhs_disable(dev);
err_enable: err_enable:
disable_put_regulator(pdata);
usb_put_hcd(hcd); usb_put_hcd(hcd);
err_io: err_io:
iounmap(regs);
return ret; return ret;
} }
...@@ -253,6 +267,8 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) ...@@ -253,6 +267,8 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
usb_remove_hcd(hcd); usb_remove_hcd(hcd);
omap_usbhs_disable(dev); omap_usbhs_disable(dev);
disable_put_regulator(dev->platform_data);
iounmap(hcd->regs);
usb_put_hcd(hcd); usb_put_hcd(hcd);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment