net: stmmac: add a parse for new property 'snps,clk-csr'
authorJianguo Zhang <jianguo.zhang@mediatek.com>
Thu, 29 Sep 2022 01:47:58 +0000 (09:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Sep 2022 12:04:23 +0000 (13:04 +0100)
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 legacy case

Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index b0b09c77711d1e8a54f72813ee106383aabea71e..50f6b4a14be4cbc027ee0844a5db896767f83873 100644 (file)
@@ -444,7 +444,8 @@ 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.