mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Holger Schurig <holgerschurig@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] sandbox: only access of_add_memory_bank if it's defined
Date: Thu, 26 Jun 2014 10:49:15 +0200	[thread overview]
Message-ID: <1403772557-28482-3-git-send-email-holgerschurig@gmail.com> (raw)

... and it's defined only when CONFIG_OFTREE_MEM_GENERIC is on.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
---
 drivers/of/base.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index c440a69..818d76e 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1697,6 +1697,7 @@ int of_set_property(struct device_node *np, const char *name, const void *val, i
 	return 0;
 }
 
+#ifdef CONFIG_OFTREE_MEM_GENERIC
 int of_add_memory(struct device_node *node, bool dump)
 {
 	const char *device_type;
@@ -1720,6 +1721,7 @@ int of_add_memory(struct device_node *node, bool dump)
 
 	return 0;
 }
+#endif
 
 static struct device_node *of_chosen;
 static const char *of_model;
@@ -1739,7 +1741,9 @@ const struct of_device_id of_default_bus_match_table[] = {
 
 int of_probe(void)
 {
+#ifdef CONFIG_OFTREE_MEM_GENERIC
 	struct device_node *memory;
+#endif
 
 	if(!root_node)
 		return -ENODEV;
@@ -1750,9 +1754,11 @@ int of_probe(void)
 	if (of_model)
 		barebox_set_model(of_model);
 
+#ifdef CONFIG_OFTREE_MEM_GENERIC
 	memory = of_find_node_by_path("/memory");
 	if (memory)
 		of_add_memory(memory, false);
+#endif
 
 	of_platform_populate(root_node, of_default_bus_match_table, NULL);
 	of_clk_init(root_node, NULL);
-- 
1.7.10.4


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

             reply	other threads:[~2014-06-26  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  8:49 Holger Schurig [this message]
2014-06-26  9:37 ` Alexander Aring
2014-06-26  9:39   ` Alexander Aring
2014-06-26  9:43   ` Holger Schurig
2014-06-26  9:48     ` Alexander Aring
2014-06-26  9:43   ` Alexander Aring
2014-06-26 20:42 ` Sascha Hauer
2014-06-27  7:28   ` Alexander Aring

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=1403772557-28482-3-git-send-email-holgerschurig@gmail.com \
    --to=holgerschurig@gmail.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