diff mbox series

[1/3] gpio: at91: use dev_read_addr() to get base address

Message ID 20200804051443.1074096-1-yamada.masahiro@socionext.com
State Accepted
Commit 0cbf3e08fc735b54e7918138e73b34870a213333
Delegated to: Simon Glass
Headers show
Series [1/3] gpio: at91: use dev_read_addr() to get base address | expand

Commit Message

Masahiro Yamada Aug. 4, 2020, 5:14 a.m. UTC
It is strange to use devfdt_get_addr_ptr(), then cast the pointer
back to uint32 because you could use devfdt_get_addr() without casting.

Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/gpio/at91_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Aug. 16, 2020, 3:39 a.m. UTC | #1
On Mon, 3 Aug 2020 at 23:15, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> It is strange to use devfdt_get_addr_ptr(), then cast the pointer
> back to uint32 because you could use devfdt_get_addr() without casting.
>
> Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  drivers/gpio/at91_gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c
index 4a8b2e6ff6..ef7984374b 100644
--- a/drivers/gpio/at91_gpio.c
+++ b/drivers/gpio/at91_gpio.c
@@ -606,7 +606,7 @@  static int at91_gpio_probe(struct udevice *dev)
 	clk_free(&clk);
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
-	plat->base_addr = (uint32_t)devfdt_get_addr_ptr(dev);
+	plat->base_addr = dev_read_addr(dev);
 #endif
 	plat->bank_name = at91_get_bank_name(plat->base_addr);
 	port->regs = (struct at91_port *)plat->base_addr;