Commit 767d011d authored by Rob Herring's avatar Rob Herring Committed by Kalle Valo

bcma: Use of_address_to_resource()

Replace of_get_address() and of_translate_address() calls with single
call to of_address_to_resource().
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230319163159.225773-1-robh@kernel.org
parent 074d0a1a
......@@ -140,17 +140,17 @@ static struct device_node *bcma_of_find_child_device(struct device *parent,
struct bcma_device *core)
{
struct device_node *node;
u64 size;
const __be32 *reg;
int ret;
if (!parent->of_node)
return NULL;
for_each_child_of_node(parent->of_node, node) {
reg = of_get_address(node, 0, &size, NULL);
if (!reg)
struct resource res;
ret = of_address_to_resource(node, 0, &res);
if (ret)
continue;
if (of_translate_address(node, reg) == core->addr)
if (res.start == core->addr)
return node;
}
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment