aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/8xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/iseries/Kconfig1
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig1
-rw-r--r--arch/powerpc/platforms/wsp/Kconfig1
-rw-r--r--drivers/of/Kconfig5
-rw-r--r--drivers/of/base.c4
-rw-r--r--include/linux/of.h14
7 files changed, 15 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig
index ee56a9ea6a79..1fb0b3cddeb3 100644
--- a/arch/powerpc/platforms/8xx/Kconfig
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -26,6 +26,7 @@ config MPC86XADS
26config MPC885ADS 26config MPC885ADS
27 bool "MPC885ADS" 27 bool "MPC885ADS"
28 select CPM1 28 select CPM1
29 select OF_DYNAMIC
29 help 30 help
30 Freescale Semiconductor MPC885 Application Development System (ADS). 31 Freescale Semiconductor MPC885 Application Development System (ADS).
31 Also known as DUET. 32 Also known as DUET.
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
index b57cda3a0817..63835e09e5cc 100644
--- a/arch/powerpc/platforms/iseries/Kconfig
+++ b/arch/powerpc/platforms/iseries/Kconfig
@@ -1,6 +1,7 @@
1config PPC_ISERIES 1config PPC_ISERIES
2 bool "IBM Legacy iSeries" 2 bool "IBM Legacy iSeries"
3 depends on PPC64 && PPC_BOOK3S 3 depends on PPC64 && PPC_BOOK3S
4 select OF_DYNAMIC
4 select PPC_SMP_MUXED_IPI 5 select PPC_SMP_MUXED_IPI
5 select PPC_INDIRECT_PIO 6 select PPC_INDIRECT_PIO
6 select PPC_INDIRECT_MMIO 7 select PPC_INDIRECT_MMIO
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index ae7b6d41fed3..1114f8f336df 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -3,6 +3,7 @@ config PPC_PSERIES
3 bool "IBM pSeries & new (POWER5-based) iSeries" 3 bool "IBM pSeries & new (POWER5-based) iSeries"
4 select HAVE_PCSPKR_PLATFORM 4 select HAVE_PCSPKR_PLATFORM
5 select MPIC 5 select MPIC
6 select OF_DYNAMIC
6 select PCI_MSI 7 select PCI_MSI
7 select PPC_XICS 8 select PPC_XICS
8 select PPC_ICP_NATIVE 9 select PPC_ICP_NATIVE
diff --git a/arch/powerpc/platforms/wsp/Kconfig b/arch/powerpc/platforms/wsp/Kconfig
index 57d22a2f4ba9..79d2225b7608 100644
--- a/arch/powerpc/platforms/wsp/Kconfig
+++ b/arch/powerpc/platforms/wsp/Kconfig
@@ -25,6 +25,7 @@ config PPC_CHROMA
25 bool "PowerEN PCIe Chroma Card" 25 bool "PowerEN PCIe Chroma Card"
26 select EPAPR_BOOT 26 select EPAPR_BOOT
27 select PPC_WSP 27 select PPC_WSP
28 select OF_DYNAMIC
28 default y 29 default y
29 30
30endmenu 31endmenu
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 268163dd71c7..6ea51dcbc728 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -35,9 +35,10 @@ config OF_EARLY_FLATTREE
35config OF_PROMTREE 35config OF_PROMTREE
36 bool 36 bool
37 37
38# Hardly any platforms need this. It is safe to select, but only do so if you
39# need it.
38config OF_DYNAMIC 40config OF_DYNAMIC
39 def_bool y 41 bool
40 depends on PPC_OF
41 42
42config OF_ADDRESS 43config OF_ADDRESS
43 def_bool y 44 def_bool y
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 13ba72875e25..580644986945 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -88,7 +88,7 @@ int of_n_size_cells(struct device_node *np)
88} 88}
89EXPORT_SYMBOL(of_n_size_cells); 89EXPORT_SYMBOL(of_n_size_cells);
90 90
91#if !defined(CONFIG_SPARC) /* SPARC doesn't do ref counting (yet) */ 91#if defined(CONFIG_OF_DYNAMIC)
92/** 92/**
93 * of_node_get - Increment refcount of a node 93 * of_node_get - Increment refcount of a node
94 * @node: Node to inc refcount, NULL is supported to 94 * @node: Node to inc refcount, NULL is supported to
@@ -161,7 +161,7 @@ void of_node_put(struct device_node *node)
161 kref_put(&node->kref, of_node_release); 161 kref_put(&node->kref, of_node_release);
162} 162}
163EXPORT_SYMBOL(of_node_put); 163EXPORT_SYMBOL(of_node_put);
164#endif /* !CONFIG_SPARC */ 164#endif /* CONFIG_OF_DYNAMIC */
165 165
166struct property *of_find_property(const struct device_node *np, 166struct property *of_find_property(const struct device_node *np,
167 const char *name, 167 const char *name,
diff --git a/include/linux/of.h b/include/linux/of.h
index 5a4a3adb17e5..533603e26b9b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -72,19 +72,17 @@ struct of_phandle_args {
72 uint32_t args[MAX_PHANDLE_ARGS]; 72 uint32_t args[MAX_PHANDLE_ARGS];
73}; 73};
74 74
75#if defined(CONFIG_SPARC) || !defined(CONFIG_OF) 75#ifdef CONFIG_OF_DYNAMIC
76extern struct device_node *of_node_get(struct device_node *node);
77extern void of_node_put(struct device_node *node);
78#else /* CONFIG_OF_DYNAMIC */
76/* Dummy ref counting routines - to be implemented later */ 79/* Dummy ref counting routines - to be implemented later */
77static inline struct device_node *of_node_get(struct device_node *node) 80static inline struct device_node *of_node_get(struct device_node *node)
78{ 81{
79 return node; 82 return node;
80} 83}
81static inline void of_node_put(struct device_node *node) 84static inline void of_node_put(struct device_node *node) { }
82{ 85#endif /* !CONFIG_OF_DYNAMIC */
83}
84#else
85extern struct device_node *of_node_get(struct device_node *node);
86extern void of_node_put(struct device_node *node);
87#endif
88 86
89#ifdef CONFIG_OF 87#ifdef CONFIG_OF
90 88