[U-Boot] [PATCH V3 10/16] dm: clk: ignore default settings when node not valid

Peng Fan peng.fan at nxp.com
Wed Jul 31 07:01:49 UTC 2019


When the device not binded with a node, we need ignore
the parents and rate settings.

Cc: Simon Glass <sjg at chromium.org>
Cc: Jagan Teki <jagan at amarulasolutions.com>
Cc: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
Cc: Neil Armstrong <narmstrong at baylibre.com>
Cc: Andreas Dannenberg <dannenberg at ti.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---

V3:
 None
V2:
 Rebase

 drivers/clk/clk-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 85dfe712f5..cee4d912b0 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -285,6 +285,9 @@ int clk_set_defaults(struct udevice *dev)
 {
 	int ret;
 
+	if (!dev_of_valid(dev))
+		return 0;
+
 	/* If this not in SPL and pre-reloc state, don't take any action. */
 	if (!(IS_ENABLED(CONFIG_SPL_BUILD) || (gd->flags & GD_FLG_RELOC)))
 		return 0;
-- 
2.16.4



More information about the U-Boot mailing list