linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bcma: Use of_address_to_resource()
@ 2023-03-19 16:31 Rob Herring
  2023-03-31 15:04 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-03-19 16:31 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, linux-kernel

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>
---
 drivers/bcma/main.c | 10 +++++-----
 1 file 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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bcma: Use of_address_to_resource()
  2023-03-19 16:31 [PATCH] bcma: Use of_address_to_resource() Rob Herring
@ 2023-03-31 15:04 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2023-03-31 15:04 UTC (permalink / raw)
  To: Rob Herring; +Cc: Rafał Miłecki, linux-wireless, linux-kernel

Rob Herring <robh@kernel.org> wrote:

> 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>

Patch applied to wireless-next.git, thanks.

767d011dc39d bcma: Use of_address_to_resource()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230319163159.225773-1-robh@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-31 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 16:31 [PATCH] bcma: Use of_address_to_resource() Rob Herring
2023-03-31 15:04 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).