/* returns: 0 on success Negative error code on failure  */
static int overlay_adjust_node_phandles(void *fdto, int node, uint32_t delta)
/* returns: 0 on success Negative error code on failure  */
static int overlay_adjust_node_phandles(void *fdto, int node, uint32_t delta)
{
	int child;
	int ret;
	ret = overlay_phandle_add_offset(fdto, node, "phandle", delta);
	if (ret && ret != -FDT_ERR_NOTFOUND)
		return ret;
	ret = overlay_phandle_add_offset(fdto, node, "linux,phandle", delta);
	if (ret && ret != -FDT_ERR_NOTFOUND)
		return ret;
	fdt_for_each_subnode(child, fdto, node) {
		ret = overlay_adjust_node_phandles(fdto, child, delta);
		if (ret)
			return ret;
	}
	return 0;
}