/* returns: 0 on success Negative error code on failure  */
static int overlay_fixup_phandles(void *fdt, void *fdto)
/* returns: 0 on success Negative error code on failure  */
static int overlay_fixup_phandles(void *fdt, void *fdto)
{
	int fixups_off, symbols_off;
	int property;
	fixups_off = fdt_path_offset(fdto, "/__fixups__");
	if (fixups_off == -FDT_ERR_NOTFOUND)
		return 0;
	if (fixups_off < 0)
		return fixups_off;
	symbols_off = fdt_path_offset(fdt, "/__symbols__");
	if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND)))
		return symbols_off;
	fdt_for_each_property_offset(property, fdto, fixups_off) {
		int ret;
		ret = overlay_fixup_phandle(fdt, fdto, symbols_off, property);
		if (ret)
			return ret;
	}
	return 0;
}