diff mbox series

[U-Boot,v3,09/19] rockchip: timer: Convert to livetree

Message ID 1505160270-10650-10-git-send-email-philipp.tomsich@theobroma-systems.com
State Accepted
Delegated to: Philipp Tomsich
Headers show
Series rockchip: convert the RK3368 to OF_LIVE and validate on the RK3368-uQ7 | expand

Commit Message

Philipp Tomsich Sept. 11, 2017, 8:04 p.m. UTC
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>

---

Changes in v3: None
Changes in v2:
- use the new dev_read_addr_ptr() function
- improve error handling, in case dev_read_addr_ptr returns NULL

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

Comments

Philipp Tomsich Sept. 12, 2017, 10:54 a.m. UTC | #1
> 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>
> ---
> 
> Changes in v3: None
> Changes in v2:
> - use the new dev_read_addr_ptr() function
> - improve error handling, in case dev_read_addr_ptr returns NULL
> 
>  drivers/timer/rockchip_timer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!
diff mbox series

Patch

diff --git a/drivers/timer/rockchip_timer.c b/drivers/timer/rockchip_timer.c
index b19aaed..07d1448 100644
--- a/drivers/timer/rockchip_timer.c
+++ b/drivers/timer/rockchip_timer.c
@@ -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;