linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nick Kossifidis <mick@ics.forth.gr>
To: devicetree@vger.kernel.org
Cc: Nick Kossifidis <mick@ics.forth.gr>,
	linux-riscv@lists.infradead.org, robh+dt@kernel.org,
	frowand.list@gmail.com, palmer@sifive.com
Subject: [PATCH] OF: Add a warning in case chosen node is not present
Date: Sat, 10 Nov 2018 02:53:17 +0200	[thread overview]
Message-ID: <20181110005317.5631-1-mick@ics.forth.gr> (raw)
Message-ID: <20181110005317.HcgzG9k2ZiHmAiuYFjgOr1umJo_vW43fhHxxpqFPoMw@z> (raw)

On architectures that only get their bootargs through devicetree's
chosen node (such as RISC-V), that node is mandatory. After a
discussion with Rob [1] I'm adding a warning in case chosen node
is not present, to let users know about it.

[1]: https://patchwork.ozlabs.org/patch/984224/#2016136

Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
---
 drivers/of/fdt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index bb532aae0d92..7ff67bf1f6d6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1200,8 +1200,12 @@ bool __init early_init_dt_verify(void *params)
 
 void __init early_init_dt_scan_nodes(void)
 {
+	int rc = 0;
+
 	/* Retrieve various information from the /chosen node */
-	of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
+	rc = of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
+	if (!rc)
+		pr_warn("No chosen node found, continuing without\n");
 
 	/* Initialize {size,address}-cells info */
 	of_scan_flat_dt(early_init_dt_scan_root, NULL);
-- 
2.16.4


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2018-11-10  0:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-10  0:53 Nick Kossifidis [this message]
2018-11-10  0:53 ` [PATCH] OF: Add a warning in case chosen node is not present Nick Kossifidis
2018-11-11 21:52 ` Palmer Dabbelt
2018-11-11 21:52   ` Palmer Dabbelt
2018-12-03 23:41 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181110005317.5631-1-mick@ics.forth.gr \
    --to=mick@ics.forth.gr \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).