[U-Boot] [PATCH v3 18/19] drivers: core: nullify gd->dm_root after dm_uninit()

Jean-Jacques Hiblot jjhiblot at ti.com
Mon Oct 22 14:12:56 UTC 2018


To reset the DM after a new dtb is loaded, we need to call dm_uninit()
and then dm_init(). This fails however because gd->dm_root is not nullified
by dm_uninit().
Fixing it by setting gd->dm_root in dm_uninit().

Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/core/root.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index b54bf5b..34d0586 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -187,6 +187,7 @@ int dm_uninit(void)
 {
 	device_remove(dm_root(), DM_REMOVE_NORMAL);
 	device_unbind(dm_root());
+	gd->dm_root = NULL;
 
 	return 0;
 }
-- 
2.7.4



More information about the U-Boot mailing list