Skip to content

Commit

Permalink
gpio: at91: use dev_read_addr() to get base address
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
masahir0y authored and sjg20 committed Aug 22, 2020
1 parent 6e64830 commit 0cbf3e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/at91_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0cbf3e0

Please sign in to comment.