mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [PATCH 1/2] of: overlay: do not parse phandles as properties
Date: Wed, 13 Jan 2021 08:57:56 +0100	[thread overview]
Message-ID: <20210113075757.21478-1-r.czerwinski@pengutronix.de> (raw)

Instead of handling phandles as properties, assign them directly as a
handle to the node. This allows phandles within nodes inside the device
tree overlays to be handled correctly.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 drivers/of/overlay.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index b79dbff94d..0bebe26e39 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -58,6 +58,11 @@ static int of_overlay_apply(struct device_node *target,
 		if (of_prop_cmp(prop->name, "name") == 0)
 			continue;
 
+		if (of_prop_cmp(prop->name, "phandle") == 0) {
+			target->phandle = be32_to_cpup(prop->value);
+			continue;
+		}
+
 		err = of_set_property(target, prop->name, prop->value,
 				      prop->length, true);
 		if (err)
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2021-01-13  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  7:57 Rouven Czerwinski [this message]
2021-01-13  7:57 ` [PATCH 2/2] ARM: qemu: support for state & env via DT overlay Rouven Czerwinski
2021-01-13  9:22 ` [PATCH 1/2] of: overlay: do not parse phandles as properties Sascha Hauer

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=20210113075757.21478-1-r.czerwinski@pengutronix.de \
    --to=r.czerwinski@pengutronix.de \
    --cc=barebox@lists.infradead.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