summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/dwc_eth_qos.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index e8242ca4e1..2f088c758f 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -321,6 +321,7 @@ struct eqos_priv {
void *rx_pkt;
bool started;
bool reg_access_ok;
+ bool clk_ck_enabled;
};
/*
@@ -591,12 +592,13 @@ static int eqos_start_clks_stm32(struct udevice *dev)
goto err_disable_clk_rx;
}
- if (clk_valid(&eqos->clk_ck)) {
+ if (clk_valid(&eqos->clk_ck) && !eqos->clk_ck_enabled) {
ret = clk_enable(&eqos->clk_ck);
if (ret < 0) {
pr_err("clk_enable(clk_ck) failed: %d", ret);
goto err_disable_clk_tx;
}
+ eqos->clk_ck_enabled = true;
}
#endif
@@ -648,8 +650,6 @@ static void eqos_stop_clks_stm32(struct udevice *dev)
clk_disable(&eqos->clk_tx);
clk_disable(&eqos->clk_rx);
clk_disable(&eqos->clk_master_bus);
- if (clk_valid(&eqos->clk_ck))
- clk_disable(&eqos->clk_ck);
#endif
debug("%s: OK\n", __func__);