mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Richardsen <jonasrichardsen@emlix.com>
To: barebox@lists.infradead.org
Cc: Jonas Richardsen <jonasrichardsen@emlix.com>
Subject: [PATCH] of: do not copy properties if they already exist in the destination
Date: Mon, 15 Apr 2024 10:14:54 +0200	[thread overview]
Message-ID: <20240415081458.295448-1-jonasrichardsen@emlix.com> (raw)
In-Reply-To: <9010811a-0bf2-45bb-8efa-7ad27f60f565@pengutronix.de>

---
 drivers/of/base.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index b22959dabe..9bb4ae13db 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2346,6 +2346,9 @@ struct property *of_copy_property(const struct device_node *src,
 	if (!prop)
 		return NULL;
 
+	if (of_find_property(dst, propname, NULL))
+		return ERR_PTR(-EEXIST);
+
 	return of_new_property(dst, propname,
 			       of_property_get_value(prop), prop->length);
 }
-- 
2.42.0




  reply	other threads:[~2024-04-15  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  9:59 raspi: should vc fixups update properties of existing nodes? Jonas Richardsen
2024-04-10 11:51 ` Ahmad Fatoum
2024-04-15  8:14   ` Jonas Richardsen [this message]
2024-04-15  8:30     ` [PATCH] of: do not copy properties if they already exist in the destination Ahmad Fatoum
2024-04-15 12:26       ` [PATCH v2] " Jonas Richardsen
2024-04-16 13:38         ` 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=20240415081458.295448-1-jonasrichardsen@emlix.com \
    --to=jonasrichardsen@emlix.com \
    --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