diff mbox

[U-Boot,v3,05/29] dm: Make sure that the root device is probed

Message ID 1406120124-9373-6-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 23, 2014, 12:55 p.m. UTC
The root device should be probed just like any other device. The effect of
this is to mark the device as activated, so that it can be removed (along
with its children) if required.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/core/root.c | 3 +++
 test/dm/core.c      | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Simon Glass July 26, 2014, 3:04 p.m. UTC | #1
On 23 July 2014 13:55, Simon Glass <sjg@chromium.org> wrote:
> The root device should be probed just like any other device. The effect of
> this is to mark the device as activated, so that it can be removed (along
> with its children) if required.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Acked-by: Marek Vasut <marex@denx.de>

Applied to dm/master.
diff mbox

Patch

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1cbb096..bc76370 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -48,6 +48,9 @@  int dm_init(void)
 	ret = device_bind_by_name(NULL, &root_info, &DM_ROOT_NON_CONST);
 	if (ret)
 		return ret;
+	ret = device_probe(DM_ROOT_NON_CONST);
+	if (ret)
+		return ret;
 
 	return 0;
 }
diff --git a/test/dm/core.c b/test/dm/core.c
index be3646b..8c18780 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -106,7 +106,7 @@  static int dm_test_autoprobe(struct dm_test_state *dms)
 	ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]);
 
 	/* The root device should not be activated until needed */
-	ut_assert(!(dms->root->flags & DM_FLAG_ACTIVATED));
+	ut_assert(dms->root->flags & DM_FLAG_ACTIVATED);
 
 	/*
 	 * We should be able to find the three test devices, and they should