From: Douglas Anderson <dianders@chromium.org>
To: Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@google.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Douglas Anderson <dianders@chromium.org>
Subject: [PATCH 2/2] checks: Allow "chosen" node under "__overlay__" for a DT fragment
Date: Mon, 10 Nov 2025 12:45:27 -0800 [thread overview]
Message-ID: <20251110204529.2838248-2-dianders@chromium.org> (raw)
In-Reply-To: <20251110204529.2838248-1-dianders@chromium.org>
If a `dtso` file adds to the chosen node, a false warning will be reported:
Warning (chosen_node_is_root): /fragment@<num>/__overlay__/chosen: chosen node must be at root node
Allow the "chosen" node to be under the "__overlay__" node at the root
of a fragment.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
checks.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/checks.c b/checks.c
index 908df5b98ec5..d28e59494757 100644
--- a/checks.c
+++ b/checks.c
@@ -1371,8 +1371,17 @@ static void check_chosen_node_is_root(struct check *c, struct dt_info *dti,
if (!streq(node->name, "chosen"))
return;
- if (node->parent != dti->dt)
- FAIL(c, dti, node, "chosen node must be at root node");
+ if (dti->dtsflags & DTSF_PLUGIN) {
+ const char *frag_path = get_fragment_relative_path(node->fullpath);
+
+ if (frag_path && streq(frag_path, "/__overlay__/chosen"))
+ return;
+ } else {
+ if (node->parent == dti->dt)
+ return;
+ }
+
+ FAIL(c, dti, node, "chosen node must be at root node");
}
WARNING(chosen_node_is_root, check_chosen_node_is_root, NULL);
--
2.51.2.1041.gc1ab5b90ca-goog
prev parent reply other threads:[~2025-11-10 20:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 20:45 [PATCH 1/2] checks: Allow "__overlay__" node at the root of an overlay fragment Douglas Anderson
2025-11-10 20:45 ` Douglas Anderson [this message]
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=20251110204529.2838248-2-dianders@chromium.org \
--to=dianders@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
/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
all inboxes | Powered by JetHome®