mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 13:54:57 +08:00
USB ehci mxc: prepare/unprepare clock
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
97c3213fd9
commit
198ad2cecd
@ -171,7 +171,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
|
|||||||
ret = PTR_ERR(priv->usbclk);
|
ret = PTR_ERR(priv->usbclk);
|
||||||
goto err_clk;
|
goto err_clk;
|
||||||
}
|
}
|
||||||
clk_enable(priv->usbclk);
|
clk_prepare_enable(priv->usbclk);
|
||||||
|
|
||||||
if (!cpu_is_mx35() && !cpu_is_mx25()) {
|
if (!cpu_is_mx35() && !cpu_is_mx25()) {
|
||||||
priv->ahbclk = clk_get(dev, "usb_ahb");
|
priv->ahbclk = clk_get(dev, "usb_ahb");
|
||||||
@ -179,7 +179,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
|
|||||||
ret = PTR_ERR(priv->ahbclk);
|
ret = PTR_ERR(priv->ahbclk);
|
||||||
goto err_clk_ahb;
|
goto err_clk_ahb;
|
||||||
}
|
}
|
||||||
clk_enable(priv->ahbclk);
|
clk_prepare_enable(priv->ahbclk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "dr" device has its own clock on i.MX51 */
|
/* "dr" device has its own clock on i.MX51 */
|
||||||
@ -189,7 +189,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
|
|||||||
ret = PTR_ERR(priv->phy1clk);
|
ret = PTR_ERR(priv->phy1clk);
|
||||||
goto err_clk_phy;
|
goto err_clk_phy;
|
||||||
}
|
}
|
||||||
clk_enable(priv->phy1clk);
|
clk_prepare_enable(priv->phy1clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -266,16 +266,16 @@ err_add:
|
|||||||
pdata->exit(pdev);
|
pdata->exit(pdev);
|
||||||
err_init:
|
err_init:
|
||||||
if (priv->phy1clk) {
|
if (priv->phy1clk) {
|
||||||
clk_disable(priv->phy1clk);
|
clk_disable_unprepare(priv->phy1clk);
|
||||||
clk_put(priv->phy1clk);
|
clk_put(priv->phy1clk);
|
||||||
}
|
}
|
||||||
err_clk_phy:
|
err_clk_phy:
|
||||||
if (priv->ahbclk) {
|
if (priv->ahbclk) {
|
||||||
clk_disable(priv->ahbclk);
|
clk_disable_unprepare(priv->ahbclk);
|
||||||
clk_put(priv->ahbclk);
|
clk_put(priv->ahbclk);
|
||||||
}
|
}
|
||||||
err_clk_ahb:
|
err_clk_ahb:
|
||||||
clk_disable(priv->usbclk);
|
clk_disable_unprepare(priv->usbclk);
|
||||||
clk_put(priv->usbclk);
|
clk_put(priv->usbclk);
|
||||||
err_clk:
|
err_clk:
|
||||||
iounmap(hcd->regs);
|
iounmap(hcd->regs);
|
||||||
@ -307,14 +307,14 @@ static int __exit ehci_mxc_drv_remove(struct platform_device *pdev)
|
|||||||
usb_put_hcd(hcd);
|
usb_put_hcd(hcd);
|
||||||
platform_set_drvdata(pdev, NULL);
|
platform_set_drvdata(pdev, NULL);
|
||||||
|
|
||||||
clk_disable(priv->usbclk);
|
clk_disable_unprepare(priv->usbclk);
|
||||||
clk_put(priv->usbclk);
|
clk_put(priv->usbclk);
|
||||||
if (priv->ahbclk) {
|
if (priv->ahbclk) {
|
||||||
clk_disable(priv->ahbclk);
|
clk_disable_unprepare(priv->ahbclk);
|
||||||
clk_put(priv->ahbclk);
|
clk_put(priv->ahbclk);
|
||||||
}
|
}
|
||||||
if (priv->phy1clk) {
|
if (priv->phy1clk) {
|
||||||
clk_disable(priv->phy1clk);
|
clk_disable_unprepare(priv->phy1clk);
|
||||||
clk_put(priv->phy1clk);
|
clk_put(priv->phy1clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user