]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio: at91: use dev_read_addr() to get base address
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 4 Aug 2020 05:14:41 +0000 (14:14 +0900)
committerSimon Glass <sjg@chromium.org>
Sat, 22 Aug 2020 14:51:44 +0000 (08:51 -0600)
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/gpio/at91_gpio.c

index 4a8b2e6ff6103f93ad17bcc7ef1426c7be969d17..ef7984374b12fb037116bccd5a2a2a25c6cef5b0 100644 (file)
@@ -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;