LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: Use of_property_read_reg() to parse "reg"
@ 2023-06-09 18:31 Rob Herring
  2023-06-15 15:23 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-06-09 18:31 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel

Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/mfd/mfd-core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 695d50b3bac6..0ed7c0d7784e 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -102,7 +102,6 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 {
 #if IS_ENABLED(CONFIG_OF)
 	struct mfd_of_node_entry *of_entry;
-	const __be32 *reg;
 	u64 of_node_addr;
 
 	/* Skip if OF node has previously been allocated to a device */
@@ -115,13 +114,10 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 		goto allocate_of_node;
 
 	/* We only care about each node's first defined address */
-	reg = of_get_address(np, 0, NULL, NULL);
-	if (!reg)
+	if (of_property_read_reg(np, 0, &of_node_addr, NULL))
 		/* OF node does not contatin a 'reg' property to match to */
 		return -EAGAIN;
 
-	of_node_addr = of_read_number(reg, of_n_addr_cells(np));
-
 	if (cell->of_reg != of_node_addr)
 		/* No match */
 		return -EAGAIN;
-- 
2.39.2


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

* Re: [PATCH] mfd: Use of_property_read_reg() to parse "reg"
  2023-06-09 18:31 [PATCH] mfd: Use of_property_read_reg() to parse "reg" Rob Herring
@ 2023-06-15 15:23 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-06-15 15:23 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-kernel

On Fri, 09 Jun 2023, Rob Herring wrote:

> Use the recently added of_property_read_reg() helper to get the
> untranslated "reg" address value.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/mfd/mfd-core.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-06-15 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09 18:31 [PATCH] mfd: Use of_property_read_reg() to parse "reg" Rob Herring
2023-06-15 15:23 ` Lee Jones

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 read-only IMAP folder(s) and NNTP newsgroup(s).