summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2019-07-05 09:23:16 -0700
committerSimon Glass <sjg@chromium.org>2019-07-24 12:54:08 -0700
commita1f99e46665855ade49935a813073860c26d2728 (patch)
treec1eb5b02906c60d47898869beb0975869b4b3077 /drivers/core/device.c
parent7efb4a6e09421a8ceaaaff61e28905ddec0c02a5 (diff)
dm: core: Call clk_set_defaults() during probe() only for a valid ofnode
Without a valid ofnode, it's meaningless to call clk_set_defaults() to process various properties. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 0d15e5062b..37d89bcd1d 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -409,10 +409,16 @@ int device_probe(struct udevice *dev)
goto fail;
}
- /* Process 'assigned-{clocks/clock-parents/clock-rates}' properties */
- ret = clk_set_defaults(dev);
- if (ret)
- goto fail;
+ /* Only handle devices that have a valid ofnode */
+ if (dev_of_valid(dev)) {
+ /*
+ * Process 'assigned-{clocks/clock-parents/clock-rates}'
+ * properties
+ */
+ ret = clk_set_defaults(dev);
+ if (ret)
+ goto fail;
+ }
if (drv->probe) {
ret = drv->probe(dev);