mirror of
https://github.com/torvalds/linux
synced 2024-10-04 18:33:42 +00:00
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: Rob Herring <robh@kernel.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230319163159.225773-1-robh@kernel.org
This commit is contained in:
parent
074d0a1ae1
commit
767d011dc3
|
@ -140,17 +140,17 @@ static struct device_node *bcma_of_find_child_device(struct device *parent,
|
||||||
struct bcma_device *core)
|
struct bcma_device *core)
|
||||||
{
|
{
|
||||||
struct device_node *node;
|
struct device_node *node;
|
||||||
u64 size;
|
int ret;
|
||||||
const __be32 *reg;
|
|
||||||
|
|
||||||
if (!parent->of_node)
|
if (!parent->of_node)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for_each_child_of_node(parent->of_node, node) {
|
for_each_child_of_node(parent->of_node, node) {
|
||||||
reg = of_get_address(node, 0, &size, NULL);
|
struct resource res;
|
||||||
if (!reg)
|
ret = of_address_to_resource(node, 0, &res);
|
||||||
|
if (ret)
|
||||||
continue;
|
continue;
|
||||||
if (of_translate_address(node, reg) == core->addr)
|
if (res.start == core->addr)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue