* [PATCH net-next v2 1/2] net: stmmac: provide stmmac_pltfr_find_clk()
2025-04-09 7:55 [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk() Russell King (Oracle)
@ 2025-04-09 8:02 ` Russell King (Oracle)
2025-04-09 8:02 ` [PATCH net-next v2 2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk() Russell King (Oracle)
2025-04-11 2:20 ` [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk() patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Russell King (Oracle) @ 2025-04-09 8:02 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Jon Hunter, linux-arm-kernel, linux-stm32,
Maxime Coquelin, netdev, Paolo Abeni, Prabhakar, Thierry Reding
Provide a generic way to find a clock in the bulk data.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +++++++++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 3 +++
2 files changed, 14 insertions(+)
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);
+
int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res)
{
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
index 72dc1a32e46d..6e6561e29d6e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
@@ -14,6 +14,9 @@
struct plat_stmmacenet_data *
devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac);
+struct clk *stmmac_pltfr_find_clk(struct plat_stmmacenet_data *plat_dat,
+ const char *name);
+
int stmmac_get_platform_resources(struct platform_device *pdev,
struct stmmac_resources *stmmac_res);
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v2 2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk()
2025-04-09 7:55 [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk() Russell King (Oracle)
2025-04-09 8:02 ` [PATCH net-next v2 1/2] net: stmmac: provide stmmac_pltfr_find_clk() Russell King (Oracle)
@ 2025-04-09 8:02 ` Russell King (Oracle)
2025-04-09 13:38 ` Andrew Lunn
2025-04-11 2:20 ` [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk() patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Russell King (Oracle) @ 2025-04-09 8:02 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Jon Hunter, linux-arm-kernel, linux-stm32,
Maxime Coquelin, netdev, Paolo Abeni, Prabhakar, Thierry Reding
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
.../stmicro/stmmac/dwmac-dwc-qos-eth.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
index cd431f84f34f..5db318327d33 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
@@ -34,16 +34,6 @@ struct tegra_eqos {
struct gpio_desc *reset;
};
-static struct clk *dwc_eth_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;
-}
-
static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat_dat)
{
@@ -132,7 +122,7 @@ static int dwc_qos_probe(struct platform_device *pdev,
struct plat_stmmacenet_data *plat_dat,
struct stmmac_resources *stmmac_res)
{
- plat_dat->pclk = dwc_eth_find_clk(plat_dat, "phy_ref_clk");
+ plat_dat->pclk = stmmac_pltfr_find_clk(plat_dat, "phy_ref_clk");
return 0;
}
@@ -242,7 +232,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
if (!is_of_node(dev->fwnode))
goto bypass_clk_reset_gpio;
- plat_dat->clk_tx_i = dwc_eth_find_clk(plat_dat, "tx");
+ plat_dat->clk_tx_i = stmmac_pltfr_find_clk(plat_dat, "tx");
eqos->reset = devm_gpiod_get(&pdev->dev, "phy-reset", GPIOD_OUT_HIGH);
if (IS_ERR(eqos->reset)) {
@@ -362,8 +352,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
if (ret)
return dev_err_probe(&pdev->dev, ret, "Failed to enable clocks\n");
- plat_dat->stmmac_clk = dwc_eth_find_clk(plat_dat,
- data->stmmac_clk_name);
+ plat_dat->stmmac_clk = stmmac_pltfr_find_clk(plat_dat,
+ data->stmmac_clk_name);
if (data->probe)
ret = data->probe(pdev, plat_dat, &stmmac_res);
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk()
2025-04-09 8:02 ` [PATCH net-next v2 2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk() Russell King (Oracle)
@ 2025-04-09 13:38 ` Andrew Lunn
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2025-04-09 13:38 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Heiner Kallweit, Alexandre Torgue, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Jon Hunter, linux-arm-kernel,
linux-stm32, Maxime Coquelin, netdev, Paolo Abeni, Prabhakar,
Thierry Reding
On Wed, Apr 09, 2025 at 09:02:25AM +0100, Russell King (Oracle) wrote:
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk()
2025-04-09 7:55 [PATCH net-next v2 0/2] net: stmmac: stmmac_pltfr_find_clk() Russell King (Oracle)
2025-04-09 8:02 ` [PATCH net-next v2 1/2] net: stmmac: provide stmmac_pltfr_find_clk() Russell King (Oracle)
2025-04-09 8:02 ` [PATCH net-next v2 2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk() Russell King (Oracle)
@ 2025-04-11 2:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-11 2:20 UTC (permalink / raw)
To: Russell King
Cc: andrew, hkallweit1, alexandre.torgue, andrew+netdev, davem,
edumazet, kuba, jonathanh, linux-arm-kernel, linux-stm32,
mcoquelin.stm32, netdev, pabeni, prabhakar.csengg, treding
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 9 Apr 2025 08:55:09 +0100 you wrote:
> Hi,
>
> The GBETH glue driver that is being proposed duplicates the clock
> finding from the bulk clock data in the stmmac platform data structure.
> iLet's provide a generic implementation that glue drivers can use, and
> convert dwc-qos-eth to use it.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] net: stmmac: provide stmmac_pltfr_find_clk()
https://git.kernel.org/netdev/net-next/c/de6487201949
- [net-next,v2,2/2] net: stmmac: dwc-qos: use stmmac_pltfr_find_clk()
https://git.kernel.org/netdev/net-next/c/34e816acdb0d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread