livetree: avoid assertion of orphan phandles with overlays
Right now, check_interrupts_property fails with overlays, as the phandle for the interrupt-parent can be orphan. Avoid this by allowing the orphan node to pass the assert check. The process_checks() call is also moved later during init sequence, so that we can use the global variable generate_fixups to check if we are compiling an overlay. Signed-off-by: Tero Kristo <t-kristo@ti.com> [dwg: Shortcut handling of invalid phandles] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
parent
c8f8194d76
commit
bba26a5291
3
dtc.c
3
dtc.c
|
@ -317,13 +317,14 @@ int main(int argc, char *argv[])
|
||||||
dti->boot_cpuid_phys = cmdline_boot_cpuid;
|
dti->boot_cpuid_phys = cmdline_boot_cpuid;
|
||||||
|
|
||||||
fill_fullpaths(dti->dt, "");
|
fill_fullpaths(dti->dt, "");
|
||||||
process_checks(force, dti);
|
|
||||||
|
|
||||||
/* on a plugin, generate by default */
|
/* on a plugin, generate by default */
|
||||||
if (dti->dtsflags & DTSF_PLUGIN) {
|
if (dti->dtsflags & DTSF_PLUGIN) {
|
||||||
generate_fixups = 1;
|
generate_fixups = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
process_checks(force, dti);
|
||||||
|
|
||||||
if (auto_label_aliases)
|
if (auto_label_aliases)
|
||||||
generate_label_tree(dti, "aliases", false);
|
generate_label_tree(dti, "aliases", false);
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,10 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
|
||||||
{
|
{
|
||||||
struct node *child, *node;
|
struct node *child, *node;
|
||||||
|
|
||||||
assert((phandle != 0) && (phandle != -1));
|
if ((phandle == 0) || (phandle == -1)) {
|
||||||
|
assert(generate_fixups);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (tree->phandle == phandle) {
|
if (tree->phandle == phandle) {
|
||||||
if (tree->deleted)
|
if (tree->deleted)
|
||||||
|
|
Loading…
Reference in New Issue