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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c
index 3838601f54..9f28cbfcf9 100644
--- a/drivers/timer/ast_timer.c
+++ b/drivers/timer/ast_timer.c
@@ -65,8 +65,8 @@ 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);
+ if (!priv->regs)
+ return -EINVAL;
priv->tmc = ast_get_timer_counter(priv->regs, AST_TICK_TIMER);