]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: fec: disable correct clk in the err path of fec_enet_clk_enable
authorLiu Xiang <liuxiang_1999@126.com>
Fri, 29 May 2020 15:24:56 +0000 (23:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jun 2020 18:45:40 +0000 (11:45 -0700)
When enable clk_ref failed, clk_ptp should be disabled rather than
clk_ref itself.

Signed-off-by: Liu Xiang <liuxiang_1999@126.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 4acb91dce5fc3c9cb2106bc2c5240f6367868162..2d0d313ee7c5a193a805f858b9fcd83f98a4ebea 100644 (file)
@@ -1981,8 +1981,12 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
        return 0;
 
 failed_clk_ref:
-       if (fep->clk_ref)
-               clk_disable_unprepare(fep->clk_ref);
+       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);
+       }
 failed_clk_ptp:
        if (fep->clk_enet_out)
                clk_disable_unprepare(fep->clk_enet_out);