timer: cadence: Use live-tree functions
Use live-tree functions.
Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/timer/cadence-ttc.c b/drivers/timer/cadence-ttc.c
index 5b91c8a..3541e5c 100644
--- a/drivers/timer/cadence-ttc.c
+++ b/drivers/timer/cadence-ttc.c
@@ -64,8 +64,10 @@
{
struct cadence_ttc_priv *priv = dev_get_priv(dev);
- priv->regs = map_physmem(devfdt_get_addr(dev),
+ priv->regs = map_physmem(dev_read_addr(dev),
sizeof(struct cadence_ttc_regs), MAP_NOCACHE);
+ if (IS_ERR(priv->regs))
+ return PTR_ERR(priv->regs);
return 0;
}