]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
remove redundant struct clk NULL checks
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Jan 2016 09:13:36 +0000 (10:13 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Mar 2016 09:24:34 +0000 (10:24 +0100)
NULL is a valid argument to clk_enable()/clk_disable(). Remove
redundant checks before calling those functions.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
drivers/net/ethernet/freescale/fec_main.c

index b2a32209ffbfc2806d725d7924b470d2752e03d5..408e64052fbde019faa81692aa8b7d6401d1e7d3 100644 (file)
@@ -1873,35 +1873,30 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
                        }
                        mutex_unlock(&fep->ptp_clk_mutex);
                }
-               if (fep->clk_ref) {
-                       ret = clk_prepare_enable(fep->clk_ref);
-                       if (ret)
-                               goto failed_clk_ref;
-               }
+
+               ret = clk_prepare_enable(fep->clk_ref);
+               if (ret)
+                       goto failed_clk_ref;
        } else {
                clk_disable_unprepare(fep->clk_ahb);
-               if (fep->clk_enet_out)
-                       clk_disable_unprepare(fep->clk_enet_out);
+               clk_disable_unprepare(fep->clk_enet_out);
                if (fep->clk_ptp) {
                        mutex_lock(&fep->ptp_clk_mutex);
                        clk_disable_unprepare(fep->clk_ptp);
                        fep->ptp_clk_on = false;
                        mutex_unlock(&fep->ptp_clk_mutex);
                }
-               if (fep->clk_ref)
-                       clk_disable_unprepare(fep->clk_ref);
+               clk_disable_unprepare(fep->clk_ref);
        }
 
        return 0;
 
 failed_clk_ref:
-       if (fep->clk_ref)
-               clk_disable_unprepare(fep->clk_ref);
+       clk_disable_unprepare(fep->clk_ref);
 failed_clk_ptp:
-       if (fep->clk_enet_out)
-               clk_disable_unprepare(fep->clk_enet_out);
+       clk_disable_unprepare(fep->clk_enet_out);
 failed_clk_enet_out:
-               clk_disable_unprepare(fep->clk_ahb);
+       clk_disable_unprepare(fep->clk_ahb);
 
        return ret;
 }