[U-Boot] [PATCH 1/4] dm: timer: Skip device that does not have a valid ofnode in pre_probe()

Bin Meng bmeng.cn at gmail.com
Fri Jul 5 16:23:15 UTC 2019


It is possible that a timer device has a null ofnode, hence there is
no need to further parse DT for the clock rate.

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

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

diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index 12ee6eb..97a4c74 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -48,6 +48,10 @@ static int timer_pre_probe(struct udevice *dev)
 	int err;
 	ulong ret;
 
+	/* It is possible that a timer device has a null ofnode */
+	if (!dev_of_valid(dev))
+		return 0;
+
 	err = clk_get_by_index(dev, 0, &timer_clk);
 	if (!err) {
 		ret = clk_get_rate(&timer_clk);
-- 
2.7.4



More information about the U-Boot mailing list