Skip to content

Commit

Permalink
net: fec: disable correct clk in the err path of fec_enet_clk_enable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Xiang authored and David S. Miller committed Jun 1, 2020
1 parent 0c34bb5 commit a74d19b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a74d19b

Please sign in to comment.