#include <common.h>
#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <linux/libfdt.h>
#include <tee/optee.h>
offs = fdt_add_subnode(fdt_blob, offs, "optee");
if (offs < 0)
- return ret;
+ return offs;
/* copy the compatible property */
prop = fdt_getprop(old_blob, old_offs, "compatible", &len);
/* optee inserts its memory regions as reserved-memory nodes */
nodeoffset = fdt_subnode_offset(old_blob, 0, "reserved-memory");
if (nodeoffset >= 0) {
- subnode = fdt_first_subnode(old_blob, nodeoffset);
- while (subnode >= 0) {
+ for (subnode = fdt_first_subnode(old_blob, nodeoffset);
+ subnode >= 0;
+ subnode = fdt_next_subnode(old_blob, subnode)) {
const char *name = fdt_get_name(old_blob,
subnode, NULL);
if (!name)
if (ret < 0)
return ret;
}
-
- subnode = fdt_next_subnode(old_blob, subnode);
}
}