Commit 83a8fe56 authored by Rob Herring's avatar Rob Herring Committed by Michael Ellerman
Browse files

powerpc/usbgecko: Use of_iomap()



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

Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230327223109.820381-1-robh@kernel.org
parent de8d11bc
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -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;