Skip to content

Commit 1fe8150

Browse files
robherringbebarino
authored andcommitted
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(). Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 53a06e5 commit 1fe8150

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/clk/mvebu/armada_ap_cp_helper.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
char *ap_cp_unique_name(struct device *dev, struct device_node *np,
1717
const char *name)
1818
{
19-
const __be32 *reg;
20-
u64 addr;
19+
struct resource res;
2120

2221
/* Do not create a name if there is no clock */
2322
if (!name)
2423
return NULL;
2524

26-
reg = of_get_property(np, "reg", NULL);
27-
addr = of_translate_address(np, reg);
25+
of_address_to_resource(np, 0, &res);
2826
return devm_kasprintf(dev, GFP_KERNEL, "%llx-%s",
29-
(unsigned long long)addr, name);
27+
(unsigned long long)res.start, name);
3028
}

0 commit comments

Comments
 (0)