treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr()

When you enable CONFIG_OF_LIVE, you will end up with a lot of
conversions.

To help this tedious work, this commit converts devfdt_get_addr_ptr()
to dev_read_addr_ptr() by coccinelle. I also removed redundant casts
because dev_read_addr_ptr() returns an opaque pointer.

To generate this commit, I ran the following semantic patch
excluding include/dm/.

  <smpl>
  @@
  type T;
  expression dev;
  @@
  -(T *)devfdt_get_addr_ptr(dev)
  +dev_read_addr_ptr(dev)
  @@
  expression dev;
  @@
  -devfdt_get_addr_ptr(dev)
  +dev_read_addr_ptr(dev)
  </smpl>

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Masahiro Yamada
2020-08-04 14:14:43 +09:00
committed by Simon Glass
parent 1450bff3e4
commit 702e57e113
18 changed files with 20 additions and 20 deletions

View File

@@ -83,7 +83,7 @@ static int hsdk_creg_gpio_probe(struct udevice *dev)
u32 shift, bit_per_gpio, activate, deactivate, gpio_count;
const u8 *defaults;
hcg->regs = (u32 *)devfdt_get_addr_ptr(dev);
hcg->regs = dev_read_addr_ptr(dev);
gpio_count = dev_read_u32_default(dev, "gpio-count", 1);
shift = dev_read_u32_default(dev, "gpio-first-shift", 0);
bit_per_gpio = dev_read_u32_default(dev, "gpio-bit-per-line", 1);