diff mbox series

[v2,06/14] net: dwc_eth_qos: Make eqos_get_tick_clk_rate callback optional

Message ID 20230201135901.482671-7-sumit.garg@linaro.org
State Accepted
Commit 9d53f335f615d6219396358dd0a8df5ab67a849a
Headers show
Series QCS404: Add ethernet and I2C drivers | expand

Commit Message

Sumit Garg Feb. 1, 2023, 1:58 p.m. UTC
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 drivers/net/dwc_eth_qos.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Ramon Fried Feb. 4, 2023, 12:41 a.m. UTC | #1
On Wed, Feb 1, 2023 at 3:59 PM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  drivers/net/dwc_eth_qos.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> 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,
> --
> 2.34.1
>

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Tom Rini Feb. 10, 2023, 6:43 p.m. UTC | #2
On Wed, Feb 01, 2023 at 07:28:53PM +0530, Sumit Garg wrote:

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

Applied to u-boot/master, thanks!
diff mbox series

Patch

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,