Thread (5 messages) 5 messages, 1 author, 2022-09-28

[PATCH v6 4/4] net: stmmac: add a parse for new property 'snps,clk-csr'

flat view
DORMANTno replies SUPERSEDED

From: Jianguo Zhang <hidden>
Date: 2022-09-28 09:11:45
Also in: linux-arm-kernel, linux-devicetree, linux-mediatek, lkml
Subsystem: networking drivers, stmmac ethernet driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Chevallier, Linus Torvalds

Revision v6 of 4 in this series.

Revisions (4)
  1. v5 [diff vs current]
  2. v6 current
  3. v6
  4. v7 [diff vs current]
Parse new property 'snps,clk-csr' firstly because the new property
is documented in binding file, if failed, fall back to old property
'clk_csr' for out-of-tree case

Signed-off-by: Jianguo Zhang <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 9f5cac4000da..4c60a89460c8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -444,7 +444,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 	 * or get clk_csr from device tree.
 	 */
 	plat->clk_csr = -1;
-	of_property_read_u32(np, "clk_csr", &plat->clk_csr);
+	if (of_property_read_u32(np, "snps,clk-csr", &plat->clk_csr))
+		of_property_read_u32(np, "clk_csr", &plat->clk_csr);
+
 
 	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
 	 * and warn of its use. Remove this when phy node support is added.
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help