net: xilinx: remove redundant null check before clk_disable_unprepare()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Mon, 7 Sep 2020 13:02:03 +0000 (21:02 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 7 Sep 2020 20:34:14 +0000 (13:34 -0700)
Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index fa5dc29..9aafd3e 100644 (file)
@@ -2038,8 +2038,7 @@ static int axienet_remove(struct platform_device *pdev)
 
        axienet_mdio_teardown(lp);
 
-       if (lp->clk)
-               clk_disable_unprepare(lp->clk);
+       clk_disable_unprepare(lp->clk);
 
        of_node_put(lp->phy_node);
        lp->phy_node = NULL;