[PATCH] FIT: Use const dtb unflatten variant

Sascha Hauer s.hauer at pengutronix.de
Wed Jan 31 03:13:28 PST 2018


This reduces the memory usage of the FIT image support. Instead of copying
the image from the DTB to the unflattened tree we let the unflattened tree
reference the data from the DTB.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index 3d0eaf4987..048425ac0b 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -691,7 +691,7 @@ static int fit_do_open(struct fit_handle *handle)
 	const char *desc = "(no description)";
 	struct device_node *root;
 
-	root = of_unflatten_dtb(handle->fit);
+	root = of_unflatten_dtb_const(handle->fit);
 	if (IS_ERR(root))
 		return PTR_ERR(root);
 
-- 
2.15.1




More information about the barebox mailing list