Subject: Re: [PATCH net-next v5 3/3] net: stmmac: Add DWMAC glue layer for Renesas GBETH

From: "Russell King (Oracle)" <[email-masked]>
Date: Mon, 7 Apr 2025 18:57:50 +0100

On Mon, Apr 07, 2025 at 01:03:17PM +0100, Prabhakar wrote:
> +static struct clk *renesas_gbeth_find_clk(struct plat_stmmacenet_data *plat_dat,
> +					  const char *name)
> +{
> +	for (unsigned int i = 0; i < plat_dat->num_clks; i++)
> +		if (!strcmp(plat_dat->clks[i].id, name))
> +			return plat_dat->clks[i].clk;
> +
> +	return NULL;
> +}

In addition to Jakub's request, I'll ask that you hold off for a week
because I have the following that I'd like to submit:

bbc73b8b6dfd net: stmmac: provide stmmac_pltfr_find_clk()

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index c73eff6a56b8..43c869f64c39 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -709,6 +709,17 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 #endif /* CONFIG_OF */
 EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt);

+struct clk *stmmac_pltfr_find_clk(struct plat_stmmacenet_data *plat_dat,
+                                 const char *name)
+{
+       for (int i = 0; i < plat_dat->num_clks; i++)
+               if (strcmp(plat_dat->clks[i].id, name) == 0)
+                       return plat_dat->clks[i].clk;
+
+       return NULL;
+}
+EXPORT_SYMBOL_GPL(stmmac_pltfr_find_clk);
+
...

which will avoid glue drivers duplicating this functionality. This will
be part of the first sets of patches I'm going to be submitting.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!