mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
dm: core: Add an ofnode function to get the devicetree root
This is needed in at least one place. Avoid the conditional code in root.c by adding this inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
e80be74934
commit
d0c20ce6bc
2 changed files with 14 additions and 6 deletions
|
@ -218,6 +218,18 @@ static inline ofnode ofnode_null(void)
|
|||
return node;
|
||||
}
|
||||
|
||||
static inline ofnode ofnode_root(void)
|
||||
{
|
||||
ofnode node;
|
||||
|
||||
if (of_live_active())
|
||||
node.np = gd_of_root();
|
||||
else
|
||||
node.of_offset = 0;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* ofnode_read_u32() - Read a 32-bit integer from a property
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue