summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch
diff options
context:
space:
mode:
authorjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-05-19 18:32:13 +0000
committerjogo <jogo@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-05-19 18:32:13 +0000
commitf6a2f33347da35ced5d08990c3bdc086c97b11c7 (patch)
tree1462b284b9bb6c1b3416a7de0ddd35dab51959c3 /target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch
parent2ce30d075aab8baa7aae7ac3d58e46690e02f282 (diff)
bcm63xx: add 3.9 support
Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36660 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch b/target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch
new file mode 100644
index 000000000..5f05685d1
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.9/021-bcm63xx_enet-properly-prepare-unprepare-clocks-befor.patch
@@ -0,0 +1,62 @@
+From 8d6b746129f11efe4ba69aeb2c982359d33c6ec3 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Mon, 10 Sep 2012 01:28:47 +0200
+Subject: [PATCH 3/3] 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: Jonas Gorski <jogo@openwrt.org>
+---
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -1670,7 +1670,7 @@ static int bcm_enet_probe(struct platfor
+ ret = PTR_ERR(priv->mac_clk);
+ goto out;
+ }
+- clk_enable(priv->mac_clk);
++ clk_prepare_enable(priv->mac_clk);
+
+ /* initialize default and fetch platform data */
+ priv->rx_ring_size = BCMENET_DEF_RX_DESC;
+@@ -1699,7 +1699,7 @@ static int bcm_enet_probe(struct platfor
+ priv->phy_clk = NULL;
+ 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 */
+@@ -1800,12 +1800,12 @@ out_uninit_hw:
+ /* turn off mdc clock */
+ enet_writel(priv, 0, ENET_MIISC_REG);
+ if (priv->phy_clk) {
+- clk_disable(priv->phy_clk);
++ clk_disable_unprepare(priv->phy_clk);
+ clk_put(priv->phy_clk);
+ }
+
+ out_put_clk_mac:
+- clk_disable(priv->mac_clk);
++ clk_disable_unprepare(priv->mac_clk);
+ clk_put(priv->mac_clk);
+ out:
+ free_netdev(dev);
+@@ -1843,10 +1843,10 @@ static int bcm_enet_remove(struct platfo
+
+ /* disable hw block clocks */
+ if (priv->phy_clk) {
+- clk_disable(priv->phy_clk);
++ clk_disable_unprepare(priv->phy_clk);
+ clk_put(priv->phy_clk);
+ }
+- clk_disable(priv->mac_clk);
++ clk_disable_unprepare(priv->mac_clk);
+ clk_put(priv->mac_clk);
+
+ platform_set_drvdata(pdev, NULL);