[PATCH 09/11] net: dwc_eth_qos: Request clk-ck earlier in probe on STM32

Marek Vasut marex at denx.de
Sat Mar 9 03:11:30 CET 2024


From: Patrick Delaunay <patrick.delaunay at foss.st.com>

Request the clk-ck earlier in probe in preparation for obtaining
the clock rate from these clk-ck in eqos_probe_syscfg_stm32() in
the follow up patch.

Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
---
Cc: Christophe Roullier <christophe.roullier at st.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Patrice Chotard <patrice.chotard at foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
Cc: Ramon Fried <rfried.dev at gmail.com>
Cc: u-boot at dh-electronics.com
Cc: uboot-stm32 at st-md-mailman.stormreply.com
---
 drivers/net/dwc_eth_qos_stm32.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dwc_eth_qos_stm32.c b/drivers/net/dwc_eth_qos_stm32.c
index 33477925ff1..4db18130765 100644
--- a/drivers/net/dwc_eth_qos_stm32.c
+++ b/drivers/net/dwc_eth_qos_stm32.c
@@ -201,6 +201,11 @@ static int eqos_probe_resources_stm32(struct udevice *dev)
 		return -EINVAL;
 	}
 
+	/* Get ETH_CLK clocks (optional) */
+	ret = clk_get_by_name(dev, "eth-ck", &eqos->clk_ck);
+	if (ret)
+		dev_dbg(dev, "No phy clock provided %d", ret);
+
 	ret = eqos_probe_syscfg_stm32(dev, interface);
 	if (ret)
 		return -EINVAL;
@@ -223,11 +228,6 @@ static int eqos_probe_resources_stm32(struct udevice *dev)
 		goto err_probe;
 	}
 
-	/*  Get ETH_CLK clocks (optional) */
-	ret = clk_get_by_name(dev, "eth-ck", &eqos->clk_ck);
-	if (ret)
-		dev_warn(dev, "No phy clock provided %d\n", ret);
-
 	dev_dbg(dev, "%s: OK\n", __func__);
 
 	return 0;
-- 
2.43.0



More information about the U-Boot mailing list