[U-Boot] [PATCH 4/4] timer: cadence: Use live-tree functions

Michal Simek michal.simek at xilinx.com
Fri May 18 08:46:16 UTC 2018


Use live-tree functions.

Reported-by: Simon Glass <sjg at chromium.org>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 drivers/timer/cadence-ttc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/timer/cadence-ttc.c b/drivers/timer/cadence-ttc.c
index 5b91c8a90b34..3541e5c84127 100644
--- a/drivers/timer/cadence-ttc.c
+++ b/drivers/timer/cadence-ttc.c
@@ -64,8 +64,10 @@ static int cadence_ttc_ofdata_to_platdata(struct udevice *dev)
 {
 	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;
 }
-- 
2.17.0



More information about the U-Boot mailing list