diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2019-07-05 09:23:15 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-07-24 12:54:08 -0700 |
commit | 7efb4a6e09421a8ceaaaff61e28905ddec0c02a5 (patch) | |
tree | 1b3fe5c4ae3f1a606f255cbc3c3c675c73c4121b /drivers/timer/timer-uclass.c | |
parent | e3665ba9d7c82f75c4dbd2057276a6990929be40 (diff) |
dm: timer: Skip device that does not have a valid ofnode in pre_probe()
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@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/timer/timer-uclass.c')
-rw-r--r-- | drivers/timer/timer-uclass.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 12ee6eb804..97a4c74851 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); |