summaryrefslogtreecommitdiff
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-19 11:31:59 -0500
committerKalle Valo <kvalo@kernel.org>2023-03-31 18:04:40 +0300
commit767d011dc39dc504b17a373ecba4966aef2b0205 (patch)
treed3f235837a2394b285d323c6f3b066515b4651ed /drivers/bcma
parent074d0a1ae1fefce3dfe73bdda855e62eb8eb2a78 (diff)
downloadlwn-767d011dc39dc504b17a373ecba4966aef2b0205.tar.gz
lwn-767d011dc39dc504b17a373ecba4966aef2b0205.zip
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
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 7b39f010bbb3..5e438f74ee4c 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -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;