net: stmmac: Remove useless test before clk_disable_unprepare
authorYueHaibing <yuehaibing@huawei.com>
Wed, 16 May 2018 10:59:19 +0000 (18:59 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 18:43:54 +0000 (14:43 -0400)
clk_disable_unprepare() already checks that the clock pointer is valid.
No need to test it before calling it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

index 13133b30b575e74a081f35158e360d7eee8b28ab..f08625a02cea03f8dcf55ca3f9cc0f06fa4e3ca5 100644 (file)
@@ -1104,30 +1104,20 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
        } else {
                if (bsp_priv->clk_enabled) {
                        if (phy_iface == PHY_INTERFACE_MODE_RMII) {
-                               if (!IS_ERR(bsp_priv->mac_clk_rx))
-                                       clk_disable_unprepare(
-                                               bsp_priv->mac_clk_rx);
+                               clk_disable_unprepare(bsp_priv->mac_clk_rx);
 
-                               if (!IS_ERR(bsp_priv->clk_mac_ref))
-                                       clk_disable_unprepare(
-                                               bsp_priv->clk_mac_ref);
+                               clk_disable_unprepare(bsp_priv->clk_mac_ref);
 
-                               if (!IS_ERR(bsp_priv->clk_mac_refout))
-                                       clk_disable_unprepare(
-                                               bsp_priv->clk_mac_refout);
+                               clk_disable_unprepare(bsp_priv->clk_mac_refout);
                        }
 
-                       if (!IS_ERR(bsp_priv->clk_phy))
-                               clk_disable_unprepare(bsp_priv->clk_phy);
+                       clk_disable_unprepare(bsp_priv->clk_phy);
 
-                       if (!IS_ERR(bsp_priv->aclk_mac))
-                               clk_disable_unprepare(bsp_priv->aclk_mac);
+                       clk_disable_unprepare(bsp_priv->aclk_mac);
 
-                       if (!IS_ERR(bsp_priv->pclk_mac))
-                               clk_disable_unprepare(bsp_priv->pclk_mac);
+                       clk_disable_unprepare(bsp_priv->pclk_mac);
 
-                       if (!IS_ERR(bsp_priv->mac_clk_tx))
-                               clk_disable_unprepare(bsp_priv->mac_clk_tx);
+                       clk_disable_unprepare(bsp_priv->mac_clk_tx);
                        /**
                         * if (!IS_ERR(bsp_priv->clk_mac))
                         *      clk_disable_unprepare(bsp_priv->clk_mac);