dm: core: Add a way to look up a phandle in an oftree
When we have multiple trees, the ofnode logic needs to be told which one to use. Create a new function which takes an oftree argument, along with a helper to obtain the FDT pointer from an oftree. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -36,6 +36,8 @@ static int dm_test_ofnode_get_by_phandle(struct unit_test_state *uts)
|
||||
/* test unknown phandle */
|
||||
ut_assert(!ofnode_valid(ofnode_get_by_phandle(0x1000000)));
|
||||
|
||||
ut_assert(ofnode_valid(oftree_get_by_phandle(oftree_default(), 1)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_ofnode_get_by_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
|
||||
|
||||
Reference in New Issue
Block a user