mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Jonas Richardsen <jonasrichardsen@emlix.com>,
	barebox@lists.infradead.org
Subject: Re: [PATCH] of: do not copy properties if they already exist in the destination
Date: Mon, 15 Apr 2024 10:30:44 +0200	[thread overview]
Message-ID: <69c9a97e-80e8-40e9-89c7-b9479f9dfd01@pengutronix.de> (raw)
In-Reply-To: <20240415081458.295448-1-jonasrichardsen@emlix.com>

On 15.04.24 10:14, Jonas Richardsen wrote:

Please write a short sentence here, justifying the change and add
you S-o-b, see https://developercertificate.org/

> ---
>  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);

Use of_property_present() here instead.

Cheers,
Ahmad

> +
>  	return of_new_property(dst, propname,
>  			       of_property_get_value(prop), prop->length);
>  }

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-04-15  8:31 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   ` [PATCH] of: do not copy properties if they already exist in the destination Jonas Richardsen
2024-04-15  8:30     ` Ahmad Fatoum [this message]
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=69c9a97e-80e8-40e9-89c7-b9479f9dfd01@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jonasrichardsen@emlix.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