public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH] powerpc: usbgecko: Use of_iomap()
@ 2023-03-27 22:31 Rob Herring
  2023-04-06  1:09 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2023-03-27 22:31 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Christophe Leroy
  Cc: linuxppc-dev, linux-kernel

Replace of_get_property()+of_translate_address()+ioremap() with a call
to of_iomap() which does all those steps.

Signed-off-by: Rob Herring <robh@kernel•org>
---
 .../platforms/embedded6xx/usbgecko_udbg.c     | 20 +------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
index e02bdabf358c..221577f32b01 100644
--- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
+++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
@@ -192,24 +192,6 @@ static int ug_udbg_getc_poll(void)
 	return ug_getc();
 }
 
-/*
- * Retrieves and prepares the virtual address needed to access the hardware.
- */
-static void __iomem *__init ug_udbg_setup_exi_io_base(struct device_node *np)
-{
-	void __iomem *exi_io_base = NULL;
-	phys_addr_t paddr;
-	const unsigned int *reg;
-
-	reg = of_get_property(np, "reg", NULL);
-	if (reg) {
-		paddr = of_translate_address(np, reg);
-		if (paddr)
-			exi_io_base = ioremap(paddr, reg[1]);
-	}
-	return exi_io_base;
-}
-
 /*
  * Checks if a USB Gecko adapter is inserted in any memory card slot.
  */
@@ -246,7 +228,7 @@ void __init ug_udbg_init(void)
 		goto out;
 	}
 
-	exi_io_base = ug_udbg_setup_exi_io_base(np);
+	exi_io_base = of_iomap(np, 0);
 	if (!exi_io_base) {
 		udbg_printf("%s: failed to setup EXI io base\n", __func__);
 		goto done;
-- 
2.39.2


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

* Re: [PATCH] powerpc: usbgecko: Use of_iomap()
  2023-03-27 22:31 [PATCH] powerpc: usbgecko: Use of_iomap() Rob Herring
@ 2023-04-06  1:09 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2023-04-06  1:09 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin, Christophe Leroy, Rob Herring
  Cc: linuxppc-dev, linux-kernel

On Mon, 27 Mar 2023 17:31:09 -0500, Rob Herring wrote:
> Replace of_get_property()+of_translate_address()+ioremap() with a call
> to of_iomap() which does all those steps.
> 
> 

Applied to powerpc/next.

[1/1] powerpc: usbgecko: Use of_iomap()
      https://git.kernel.org/powerpc/c/83a8fe569ef84d6eefcb99420a731cb87508f004

cheers

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

end of thread, other threads:[~2023-04-06  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27 22:31 [PATCH] powerpc: usbgecko: Use of_iomap() Rob Herring
2023-04-06  1:09 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox