diff mbox series

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

Message ID 1538757935-6481-19-git-send-email-jjhiblot@ti.com
State Superseded
Delegated to: Tom Rini
Headers show
Series DM_I2C_COMPAT removal for all ti platforms | expand

Commit Message

Jean-Jacques Hiblot Oct. 5, 2018, 4:45 p.m. UTC
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@ti.com>
---

Changes in v2: None

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

Comments

Simon Glass Oct. 11, 2018, 3:13 a.m. UTC | #1
On 5 October 2018 at 10:45, Jean-Jacques Hiblot <jjhiblot@ti.com> wrote:
> 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@ti.com>
> ---
>
> Changes in v2: None
>
>  drivers/core/root.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 47d10b8..ce59697 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;
 }