From: Bin Meng Date: Fri, 5 Jul 2019 09:23:16 -0700 Subject: [U-Boot] [PATCH 2/4] dm: core: Call clk_set_defaults() during probe() only for a valid ofnode In-Reply-To: <1562343798-24911-1-git-send-email-bmeng.cn@gmail.com> References: <1562343798-24911-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1562343798-24911-2-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Without a valid ofnode, it's meaningless to call clk_set_defaults() to process various properties. Signed-off-by: Bin Meng --- drivers/core/device.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 0d15e50..37d89bc 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); -- 2.7.4