net: ethoc: Remove useless test before clk_disable_unprepare
authorYueHaibing <yuehaibing@huawei.com>
Wed, 16 May 2018 11:18:22 +0000 (19:18 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 18:44:29 +0000 (14:44 -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>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ethoc.c

index 8bb0db990c8fcf8258201f1af5fcf3fa9976b5f9..00a57273b753660f07abff48b6fc49e775710b07 100644 (file)
@@ -1246,8 +1246,7 @@ error:
        mdiobus_unregister(priv->mdio);
        mdiobus_free(priv->mdio);
 free2:
-       if (priv->clk)
-               clk_disable_unprepare(priv->clk);
+       clk_disable_unprepare(priv->clk);
 free:
        free_netdev(netdev);
 out:
@@ -1271,8 +1270,7 @@ static int ethoc_remove(struct platform_device *pdev)
                        mdiobus_unregister(priv->mdio);
                        mdiobus_free(priv->mdio);
                }
-               if (priv->clk)
-                       clk_disable_unprepare(priv->clk);
+               clk_disable_unprepare(priv->clk);
                unregister_netdev(netdev);
                free_netdev(netdev);
        }