OSDN Git Service

bcm63xx_enet: drop unneeded NULL phy_clk check
authorJonas Gorski <jonas.gorski@gmail.com>
Sun, 1 Oct 2017 11:02:19 +0000 (13:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Oct 2017 06:05:11 +0000 (23:05 -0700)
clk_disable and clk_unprepare are NULL-safe, so need to duplicate the
NULL check of the functions.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcm63xx_enet.c

index 059ef4f..f6bc13f 100644 (file)
@@ -1903,8 +1903,7 @@ out_free_mdio:
 out_uninit_hw:
        /* turn off mdc clock */
        enet_writel(priv, 0, ENET_MIISC_REG);
-       if (priv->phy_clk)
-               clk_disable_unprepare(priv->phy_clk);
+       clk_disable_unprepare(priv->phy_clk);
 
 out_disable_clk_mac:
        clk_disable_unprepare(priv->mac_clk);
@@ -1943,9 +1942,7 @@ static int bcm_enet_remove(struct platform_device *pdev)
        }
 
        /* disable hw block clocks */
-       if (priv->phy_clk)
-               clk_disable_unprepare(priv->phy_clk);
-
+       clk_disable_unprepare(priv->phy_clk);
        clk_disable_unprepare(priv->mac_clk);
 
        free_netdev(dev);