mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/4] ARM: start: do not change barebox_boarddata
Date: Thu, 16 Jun 2016 15:18:20 +0200	[thread overview]
Message-ID: <1466083102-6241-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1466083102-6241-1-git-send-email-s.hauer@pengutronix.de>

barebox_boarddata should stay the original boarddata and not
be modified. Keep a local pointer in barebox_arm_boot_dtb()
instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/start.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index e037d91..d6a4c62 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -73,6 +73,10 @@ void *barebox_arm_boot_dtb(void)
 	void *data;
 	int ret;
 	struct barebox_arm_boarddata_compressed_dtb *compressed_dtb;
+	static void *boot_dtb;
+
+	if (boot_dtb)
+		return boot_dtb;
 
 	if (barebox_boarddata && blob_is_fdt(barebox_boarddata)) {
 		pr_debug("%s: using barebox_boarddata\n", __func__);
@@ -101,9 +105,9 @@ void *barebox_arm_boot_dtb(void)
 		return NULL;
 	}
 
-	barebox_boarddata = dtb;
+	boot_dtb = dtb;
 
-	return barebox_boarddata;
+	return boot_dtb;
 }
 
 static inline unsigned long arm_mem_boarddata(unsigned long membase,
-- 
2.8.1


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

  reply	other threads:[~2016-06-16 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 13:18 [PATCH 1/4] ARM: start: Fix arm_mem_barebox_image for !CONFIG_RELOCATABLE Sascha Hauer
2016-06-16 13:18 ` Sascha Hauer [this message]
2016-06-16 13:18 ` [PATCH 3/4] ARM: start: simplify board_data sdram allocation Sascha Hauer
2016-06-16 13:18 ` [PATCH 4/4] ARM: start: drop unnecessary variable 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=1466083102-6241-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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