From: Sumit Garg <sumit.garg@linaro.org>
Date: Wed, 1 Feb 2023 13:58:53 +0000 (+0530)
Subject: net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional
X-Git-Tag: v2025.01-rc5-pxa1908~1113^2~15
X-Git-Url: http://git.dujemihanovic.xyz/%22bddb.css/static/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=9d53f335f615d6219396358dd0a8df5ab67a849a;p=u-boot.git

net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
---

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index afc47b56ff..753a912607 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -774,10 +774,13 @@ static int eqos_start(struct udevice *dev)
 		pr_err("eqos_calibrate_pads() failed: %d", ret);
 		goto err_stop_resets;
 	}
-	rate = eqos->config->ops->eqos_get_tick_clk_rate(dev);
 
-	val = (rate / 1000000) - 1;
-	writel(val, &eqos->mac_regs->us_tic_counter);
+	if (eqos->config->ops->eqos_get_tick_clk_rate) {
+		rate = eqos->config->ops->eqos_get_tick_clk_rate(dev);
+
+		val = (rate / 1000000) - 1;
+		writel(val, &eqos->mac_regs->us_tic_counter);
+	}
 
 	/*
 	 * if PHY was already connected and configured,