On 3/9/24 03:11, Marek Vasut wrote:
From: Patrick Delaunay <patrick.delau...@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.delau...@foss.st.com>
---
Cc: Christophe Roullier <christophe.roull...@st.com>
Cc: Joe Hershberger <joe.hershber...@ni.com>
Cc: Patrice Chotard <patrice.chot...@foss.st.com>
Cc: Patrick Delaunay <patrick.delau...@foss.st.com>
Cc: Ramon Fried <rfried....@gmail.com>
Cc: u-b...@dh-electronics.com
Cc: uboot-st...@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;

Reviewed-by: Christophe ROULLIER <christophe.roull...@foss.st.com>

Reply via email to