summaryrefslogtreecommitdiff
path: root/drivers/timer/ast_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/timer/ast_timer.c')
-rw-r--r--drivers/timer/ast_timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c
index 3838601f54..e313249740 100644
--- a/drivers/timer/ast_timer.c
+++ b/drivers/timer/ast_timer.c
@@ -64,9 +64,9 @@ 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);
- if (IS_ERR(priv->regs))
- return PTR_ERR(priv->regs);
+ priv->regs = dev_read_addr_ptr(dev);
+ if (!priv->regs)
+ return -EINVAL;
priv->tmc = ast_get_timer_counter(priv->regs, AST_TICK_TIMER);