mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/3] of: remove unused and misleading #cells in /memreserve
Date: Thu,  9 Jun 2022 13:18:09 +0200	[thread overview]
Message-ID: <20220609111810.2454588-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220609111810.2454588-1-a.fatoum@pengutronix.de>

barebox creates a /memreserve node to hold FDT reservation entries
inside its reg property for unflattened device trees that are copied
back into the FDT reservation table on flattening.

These reservation entries are pairs of big-endian 64-bit start+size
pairs. To properly describe these in DT, we would need the
(#address|#size)-cells properties at the root node, not in the same node
having the reg property. As we don't read back these properties anyway,
just drop them.

No functional change.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
  - new patch
---
 drivers/of/fdt.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 5ccbd1bb69f8..42f45bbd4fb5 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -70,7 +70,6 @@ static int of_unflatten_reservemap(struct device_node *root,
 	int n;
 	struct property *p;
 	struct device_node *memreserve;
-	__be32 cells;
 
 	n = of_reservemap_num_entries(fdt);
 	if (n <= 0)
@@ -80,16 +79,6 @@ static int of_unflatten_reservemap(struct device_node *root,
 	if (!memreserve)
 		return -ENOMEM;
 
-	cells = cpu_to_be32(2);
-
-	p = of_new_property(memreserve, "#address-cells", &cells, sizeof(__be32));
-	if (!p)
-		return -ENOMEM;
-
-	p = of_new_property(memreserve, "#size-cells", &cells, sizeof(__be32));
-	if (!p)
-		return -ENOMEM;
-
 	p = of_new_property(memreserve, "reg",
 			    (void *)fdt + be32_to_cpu(fdt->off_mem_rsvmap),
 			    n * sizeof(struct fdt_reserve_entry));
-- 
2.30.2


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


  reply	other threads:[~2022-06-09 11:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 11:18 [PATCH v2 1/3] nvmem: rmem: get, don't request, memory region Ahmad Fatoum
2022-06-09 11:18 ` Ahmad Fatoum [this message]
2022-06-09 11:18 ` [PATCH v2 3/3] of: request reserved memory regions so other code can't Ahmad Fatoum
2022-06-15  5:08   ` Sascha Hauer
2022-06-15  6:06     ` Ahmad Fatoum
2022-06-15  6:28       ` Sascha Hauer
2022-06-10  8:13 ` [PATCH v2 1/3] nvmem: rmem: get, don't request, memory region 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=20220609111810.2454588-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@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