rockchip: timer: Convert to livetree
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Mon, 11 Sep 2017 20:04:17 +0000 (22:04 +0200)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Mon, 18 Sep 2017 18:40:34 +0000 (20:40 +0200)
Update the Rockchip timer driver to support a live device tree.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/timer/rockchip_timer.c

index 3c07506..460eb82 100644 (file)
@@ -101,7 +101,9 @@ static int rockchip_clk_ofdata_to_platdata(struct udevice *dev)
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
        struct rockchip_timer_priv *priv = dev_get_priv(dev);
 
-       priv->timer = (struct rk_timer *)devfdt_get_addr(dev);
+       priv->timer = dev_read_addr_ptr(dev);
+       if (!priv->timer)
+               return -ENOENT;
 #endif
 
        return 0;