mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 2/4] sandbox: only access of_add_memory_bank if it's defined
@ 2014-06-26  8:49 Holger Schurig
  2014-06-26  9:37 ` Alexander Aring
  2014-06-26 20:42 ` Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Holger Schurig @ 2014-06-26  8:49 UTC (permalink / raw)
  To: barebox

... 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-27  7:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26  8:49 [PATCH 2/4] sandbox: only access of_add_memory_bank if it's defined Holger Schurig
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox