Commit 624e2d21 authored by Jonas Gorski's avatar Jonas Gorski Committed by David S. Miller

bcm63xx_enet: properly prepare/unprepare clocks before/after usage

Use clk_prepare_enable/disable_unprepare calls in preparation for
switching to the generic clock framework.
Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
Acked-by: default avatarKevin Cernekee <cernekee@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2a80b5e1
...@@ -1670,7 +1670,7 @@ static int bcm_enet_probe(struct platform_device *pdev) ...@@ -1670,7 +1670,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
ret = PTR_ERR(priv->mac_clk); ret = PTR_ERR(priv->mac_clk);
goto out; goto out;
} }
clk_enable(priv->mac_clk); clk_prepare_enable(priv->mac_clk);
/* initialize default and fetch platform data */ /* initialize default and fetch platform data */
priv->rx_ring_size = BCMENET_DEF_RX_DESC; priv->rx_ring_size = BCMENET_DEF_RX_DESC;
...@@ -1699,7 +1699,7 @@ static int bcm_enet_probe(struct platform_device *pdev) ...@@ -1699,7 +1699,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
priv->phy_clk = NULL; priv->phy_clk = NULL;
goto out_put_clk_mac; goto out_put_clk_mac;
} }
clk_enable(priv->phy_clk); clk_prepare_enable(priv->phy_clk);
} }
/* do minimal hardware init to be able to probe mii bus */ /* do minimal hardware init to be able to probe mii bus */
...@@ -1800,12 +1800,12 @@ static int bcm_enet_probe(struct platform_device *pdev) ...@@ -1800,12 +1800,12 @@ static int bcm_enet_probe(struct platform_device *pdev)
/* turn off mdc clock */ /* turn off mdc clock */
enet_writel(priv, 0, ENET_MIISC_REG); enet_writel(priv, 0, ENET_MIISC_REG);
if (priv->phy_clk) { if (priv->phy_clk) {
clk_disable(priv->phy_clk); clk_disable_unprepare(priv->phy_clk);
clk_put(priv->phy_clk); clk_put(priv->phy_clk);
} }
out_put_clk_mac: out_put_clk_mac:
clk_disable(priv->mac_clk); clk_disable_unprepare(priv->mac_clk);
clk_put(priv->mac_clk); clk_put(priv->mac_clk);
out: out:
free_netdev(dev); free_netdev(dev);
...@@ -1843,10 +1843,10 @@ static int bcm_enet_remove(struct platform_device *pdev) ...@@ -1843,10 +1843,10 @@ static int bcm_enet_remove(struct platform_device *pdev)
/* disable hw block clocks */ /* disable hw block clocks */
if (priv->phy_clk) { if (priv->phy_clk) {
clk_disable(priv->phy_clk); clk_disable_unprepare(priv->phy_clk);
clk_put(priv->phy_clk); clk_put(priv->phy_clk);
} }
clk_disable(priv->mac_clk); clk_disable_unprepare(priv->mac_clk);
clk_put(priv->mac_clk); clk_put(priv->mac_clk);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
......
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