Skip to contentSkip to conversation

clk: mvebu: Use of_address_to_resource()

PATCH Applied Rob Herring 2 participants 2 messages Apr 6, 2023 – Jun 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: mvebu: Use of_address_to_resource()

Replace of_get_property() and of_translate_address() calls with a single call to of_address_to_resource().

---
One more to add to the prior series[1]. Though there is no dependency and this isn't for cpu nodes.

[1] https://lore.kernel.org/all/[email protected]/

 drivers/clk/mvebu/armada_ap_cp_helper.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/clk/mvebu/armada_ap_cp_helper.c +3 -5
index 6a930f697ee5..e7005de66327 100644
@@ -16,15 +16,13 @@
 char *ap_cp_unique_name(struct device *dev, struct device_node *np,
 			const char *name)
 {
-	const __be32 *reg;
-	u64 addr;
+	struct resource res;
 
 	/* Do not create a name if there is no clock */
 	if (!name)
 		return NULL;
 
-	reg = of_get_property(np, "reg", NULL);
-	addr = of_translate_address(np, reg);
+	of_address_to_resource(np, 0, &res);
 	return devm_kasprintf(dev, GFP_KERNEL, "%llx-%s",
-			      (unsigned long long)addr, name);
+			      (unsigned long long)res.start, name);
 }
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw

Quoting Rob Herring (2023-04-05 18:07:38)

Quoted 5 lines

Replace of_get_property() and of_translate_address() calls with a single call to of_address_to_resource().

---

Applied to clk-next