]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
net: bcmgenet: fix bcmgenet_wol_resume
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 21 Jul 2014 22:29:27 +0000 (15:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jul 2014 23:04:31 +0000 (16:04 -0700)
bcmgenet_wol_resume() will create an unbalanced clock state for the
wol_clk clock pointer since everywhere else in the code, we always call
clk_prepare_enable() and clk_disable_unprepare(). This function also
calls init_umac() which is neither correct nor necessary since
bcmgenet_resume() and bcmgenet_open() already does that.

Finally calling bcmgenet_wol_resume() in bcmgenet_open() is not correct,
since the interface would not have been able to put us in Wake-on-LAN
mode if it was not UP before.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index 319b94381d2e17156dad3452a30fd7dd76ee0ca1..1925ae1dc1e60b317b6b00b0ab18a0b5c9ebdfb5 100644 (file)
@@ -1965,14 +1965,8 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv,
 
 static int bcmgenet_wol_resume(struct bcmgenet_priv *priv)
 {
-       int ret;
-
        /* From WOL-enabled suspend, switch to regular clock */
-       clk_disable(priv->clk_wol);
-       /* init umac registers to synchronize s/w with h/w */
-       ret = init_umac(priv);
-       if (ret)
-               return ret;
+       clk_disable_unprepare(priv->clk_wol);
 
        phy_init_hw(priv->phydev);
        /* Speed settings must be restored */