diff options
author | Liu Xiang <liuxiang_1999@126.com> | 2020-05-29 23:24:56 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-01 11:45:40 -0700 |
commit | a74d19ba7c41b6c1e424ef4fb7d4600f43ff75e5 (patch) | |
tree | 3cfac353ac4a3c4464edb49a9104a3f94a376d4b /drivers | |
parent | 0c34bb598c510e070160029f34efeeb217000f8d (diff) |
net: fec: disable correct clk in the err path of fec_enet_clk_enable
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 4acb91dce5fc..2d0d313ee7c5 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -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); |