1 From 8d6b746129f11efe4ba69aeb2c982359d33c6ec3 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Mon, 10 Sep 2012 01:28:47 +0200
4 Subject: [PATCH 3/3] bcm63xx_enet: properly prepare/unprepare clocks
7 Use clk_prepare_enable/disable_unprepare calls in preparation for
8 switching to the generic clock framework.
10 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
12 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 12 ++++++------
13 1 file changed, 6 insertions(+), 6 deletions(-)
15 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
16 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
17 @@ -1671,7 +1671,7 @@ static int bcm_enet_probe(struct platfor
18 ret = PTR_ERR(priv->mac_clk);
21 - clk_enable(priv->mac_clk);
22 + clk_prepare_enable(priv->mac_clk);
24 /* initialize default and fetch platform data */
25 priv->rx_ring_size = BCMENET_DEF_RX_DESC;
26 @@ -1700,7 +1700,7 @@ static int bcm_enet_probe(struct platfor
30 - clk_enable(priv->phy_clk);
31 + clk_prepare_enable(priv->phy_clk);
34 /* do minimal hardware init to be able to probe mii bus */
35 @@ -1801,12 +1801,12 @@ out_uninit_hw:
36 /* turn off mdc clock */
37 enet_writel(priv, 0, ENET_MIISC_REG);
39 - clk_disable(priv->phy_clk);
40 + clk_disable_unprepare(priv->phy_clk);
41 clk_put(priv->phy_clk);
45 - clk_disable(priv->mac_clk);
46 + clk_disable_unprepare(priv->mac_clk);
47 clk_put(priv->mac_clk);
50 @@ -1844,10 +1844,10 @@ static int bcm_enet_remove(struct platfo
52 /* disable hw block clocks */
54 - clk_disable(priv->phy_clk);
55 + clk_disable_unprepare(priv->phy_clk);
56 clk_put(priv->phy_clk);
58 - clk_disable(priv->mac_clk);
59 + clk_disable_unprepare(priv->mac_clk);
60 clk_put(priv->mac_clk);
62 platform_set_drvdata(pdev, NULL);