Skip to contentSkip to conversation

clk: ti: Use of_address_to_resource()

PATCH Applied Rob Herring 3 participants 4 messages Mar 19, 2023 – Mar 27, 2023

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

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

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

---
 drivers/clk/ti/clkctrl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/ti/clkctrl.c +3 -3
index f73f402ff7de..b6fce916967c 100644
@@ -512,16 +512,16 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
 	struct clk_hw_omap *hw;
 	struct clk *clk;
 	struct omap_clkctrl_clk *clkctrl_clk = NULL;
-	const __be32 *addrp;
 	bool legacy_naming;
 	const char *clkctrl_name;
 	u32 addr;
 	int ret;
 	char *c;
 	u16 soc_mask = 0;
+	struct resource res;
 
-	addrp = of_get_address(node, 0, NULL, NULL);
-	addr = (u32)of_translate_address(node, addrp);
+	of_address_to_resource(node, 0, &res);
+	addr = (u32)res.start;
 
 #ifdef CONFIG_ARCH_OMAP4
 	if (of_machine_is_compatible("ti,omap4"))
Signature · 1 line
2.39.2
#1 lore raw
Quoted 2 lines · Rob Herring

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

Applying into omap-for-v6.4/ti-sysc thanks.

Tony

Reviewed-by
#2 lore raw
Quoted 5 lines · Tony Lindgren
Quoted 2 lines · Rob Herring

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

Applying into omap-for-v6.4/ti-sysc thanks.

Oops, sorry, was not planning on applying clock patches :) Up to Stephen to apply it.