mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
of/flattree: merge of_get_flat_dt_root
Merge common code between PowerPC and MicroBlaze Signed-off-by: Grant Likely <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Tested-by: Michal Simek <[email protected]>
This commit is contained in:
parent
c8cb7a5984
commit
819d281930
3 changed files with 16 additions and 24 deletions
|
|
@ -83,3 +83,19 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
|
|||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* of_get_flat_dt_root - find the root node in the flat blob
|
||||
*/
|
||||
unsigned long __init of_get_flat_dt_root(void)
|
||||
{
|
||||
unsigned long p = ((unsigned long)initial_boot_params) +
|
||||
initial_boot_params->off_dt_struct;
|
||||
|
||||
while (*((u32 *)p) == OF_DT_NOP)
|
||||
p += 4;
|
||||
BUG_ON(*((u32 *)p) != OF_DT_BEGIN_NODE);
|
||||
p += 4;
|
||||
return _ALIGN(p + strlen((char *)p) + 1, 4);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue