summaryrefslogtreecommitdiff
path: root/drivers/timer
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/timer')
-rw-r--r--drivers/timer/goldfish_timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/timer/goldfish_timer.c b/drivers/timer/goldfish_timer.c
index 91277d7932a..59ce43fcb46 100644
--- a/drivers/timer/goldfish_timer.c
+++ b/drivers/timer/goldfish_timer.c
@@ -45,8 +45,10 @@ static int goldfish_timer_of_to_plat(struct udevice *dev)
fdt_addr_t addr;
addr = dev_read_addr(dev);
- if (addr != FDT_ADDR_T_NONE)
- plat->reg = addr;
+ if (addr == FDT_ADDR_T_NONE)
+ return -EINVAL;
+
+ plat->reg = addr;
return 0;
}