libfdt: overlay: Fix symbols and fixups nodes condition

Some base device tree might not have any __symbols__ nodes, since they
might not have any phandle at all.

Similarly, if an overlay doesn't use any base device tree phandles, its
__fixups__ node will be empty.

In such cases, we don't want to stop the phandle parsing, but rather just
ignore the error reported about the missing node.

If it's actually an issue for the overlay we're trying to apply on a given
base device tree, it will be caught later on, but we cannot make the
assumption that early in the application process.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Maxime Ripard 2016-10-06 13:39:58 +02:00 committed by David Gibson
parent cabbaa972c
commit 7a72d89d3f
1 changed files with 3 additions and 4 deletions

View File

@ -492,13 +492,12 @@ static int overlay_fixup_phandles(void *fdt, void *fdto)
/* We can have overlays without any fixups */
fixups_off = fdt_path_offset(fdto, "/__fixups__");
if (fixups_off == -FDT_ERR_NOTFOUND)
return 0;
if (fixups_off < 0)
if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND)))
return fixups_off;
/* And base DTs without symbols */
symbols_off = fdt_path_offset(fdt, "/__symbols__");
if (symbols_off < 0)
if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND)))
return symbols_off;
fdt_for_each_property_offset(property, fdto, fixups_off) {