From 702e57e113d85fef60ebe9e5c87194414666cfac Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Tue, 4 Aug 2020 14:14:43 +0900 Subject: 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/. @@ 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) Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- drivers/timer/ast_timer.c | 2 +- drivers/timer/atmel_pit_timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/timer') diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c index 9f28cbfcf9..e313249740 100644 --- a/drivers/timer/ast_timer.c +++ b/drivers/timer/ast_timer.c @@ -64,7 +64,7 @@ static int ast_timer_ofdata_to_platdata(struct udevice *dev) { struct ast_timer_priv *priv = dev_get_priv(dev); - priv->regs = devfdt_get_addr_ptr(dev); + priv->regs = dev_read_addr_ptr(dev); if (!priv->regs) return -EINVAL; diff --git a/drivers/timer/atmel_pit_timer.c b/drivers/timer/atmel_pit_timer.c index 70511697fe..843d670b5e 100644 --- a/drivers/timer/atmel_pit_timer.c +++ b/drivers/timer/atmel_pit_timer.c @@ -64,7 +64,7 @@ static int atmel_pit_ofdata_to_platdata(struct udevice *dev) { struct atmel_pit_platdata *plat = dev_get_platdata(dev); - plat->regs = (struct atmel_pit_regs *)devfdt_get_addr_ptr(dev); + plat->regs = dev_read_addr_ptr(dev); return 0; } -- cgit