[d-kernel] [PATCH 29/39] clk: use "cmu-id" if there is no "reg" in devicetree

Daniil Gnusarev gnusarevda на basealt.ru
Пн Окт 14 17:02:10 MSK 2024


In early SDK before version 5.7 there is no parameter "reg" in devicetree,
the specified "cmu-id" is used instead

Signed-off-by: Daniil Gnusarev <gnusarevda на basealt.ru>
---
 drivers/clk/baikal/clk-bm1000.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/baikal/clk-bm1000.c b/drivers/clk/baikal/clk-bm1000.c
index d986c8ea2a633..9d16224a8f89b 100644
--- a/drivers/clk/baikal/clk-bm1000.c
+++ b/drivers/clk/baikal/clk-bm1000.c
@@ -241,8 +241,12 @@ static int baikal_clk_probe(struct platform_device *pdev)
 	of_property_read_string(node, "clock-output-names", &cmu->name);
 	of_property_read_u32(node, "clock-frequency", &cmu->parent);
 	rc = of_property_read_u64(node, "reg", &base);
-	if (rc)
-		return rc;
+	if (rc) {
+		base = 0;
+		rc = of_property_read_u32(node, "cmu-id", (void *)&base);
+		if (rc)
+			return rc;
+	}
 
 	cmu->base = base;
 
@@ -822,6 +826,7 @@ device_initcall(bm1000_cmu_driver_acpi_init);
 
 static const struct of_device_id baikal_clk_of_match[] = {
 	{ .compatible = "baikal,bm1000-cmu" },
+	{ .compatible = "baikal,cmu" },
 	{ }
 };
 
-- 
2.42.2



Подробная информация о списке рассылки devel-kernel