From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEvkM-0008PE-TW for barebox@lists.infradead.org; Thu, 08 Dec 2016 10:16:15 +0000 From: Philipp Zabel Date: Thu, 8 Dec 2016 11:15:51 +0100 Message-Id: <20161208101551.32119-1-p.zabel@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] of: base: add chosen node if it does not exist when adding initrd To: barebox@lists.infradead.org If the chosen node does not exist, of_add_initrd fails to pass the initrd to the kernel. Instead it should create the chosen node, just like of_fixup_bootargs does. Signed-off-by: Philipp Zabel --- drivers/of/base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 767d4e1..0c20fcd 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2019,9 +2019,9 @@ int of_add_initrd(struct device_node *root, resource_size_t start, struct device_node *chosen; __be32 buf[2]; - chosen = of_find_node_by_path_from(root, "/chosen"); + chosen = of_create_node(root, "/chosen"); if (!chosen) - return -EINVAL; + return -ENOMEM; if (end) { of_write_number(buf, start, 2); -- 2.10.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox