aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/prom.h4
-rw-r--r--arch/microblaze/kernel/prom.c59
-rw-r--r--arch/powerpc/include/asm/prom.h4
-rw-r--r--arch/powerpc/kernel/prom.c59
4 files changed, 0 insertions, 126 deletions
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 07d1063f9aae..6c6b386cf3c6 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -39,10 +39,6 @@ extern struct device_node *of_chosen;
39 39
40extern rwlock_t devtree_lock; /* temporary while merging */ 40extern rwlock_t devtree_lock; /* temporary while merging */
41 41
42/* For updating the device tree at runtime */
43extern void of_attach_node(struct device_node *);
44extern void of_detach_node(struct device_node *);
45
46/* Other Prototypes */ 42/* Other Prototypes */
47extern int early_uartlite_console(void); 43extern int early_uartlite_console(void);
48 44
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index cd158ef5b583..8171282a0b0d 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -197,65 +197,6 @@ struct device_node *of_find_node_by_phandle(phandle handle)
197} 197}
198EXPORT_SYMBOL(of_find_node_by_phandle); 198EXPORT_SYMBOL(of_find_node_by_phandle);
199 199
200/*
201 * Plug a device node into the tree and global list.
202 */
203void of_attach_node(struct device_node *np)
204{
205 unsigned long flags;
206
207 write_lock_irqsave(&devtree_lock, flags);
208 np->sibling = np->parent->child;
209 np->allnext = allnodes;
210 np->parent->child = np;
211 allnodes = np;
212 write_unlock_irqrestore(&devtree_lock, flags);
213}
214
215/*
216 * "Unplug" a node from the device tree. The caller must hold
217 * a reference to the node. The memory associated with the node
218 * is not freed until its refcount goes to zero.
219 */
220void of_detach_node(struct device_node *np)
221{
222 struct device_node *parent;
223 unsigned long flags;
224
225 write_lock_irqsave(&devtree_lock, flags);
226
227 parent = np->parent;
228 if (!parent)
229 goto out_unlock;
230
231 if (allnodes == np)
232 allnodes = np->allnext;
233 else {
234 struct device_node *prev;
235 for (prev = allnodes;
236 prev->allnext != np;
237 prev = prev->allnext)
238 ;
239 prev->allnext = np->allnext;
240 }
241
242 if (parent->child == np)
243 parent->child = np->sibling;
244 else {
245 struct device_node *prevsib;
246 for (prevsib = np->parent->child;
247 prevsib->sibling != np;
248 prevsib = prevsib->sibling)
249 ;
250 prevsib->sibling = np->sibling;
251 }
252
253 of_node_set_flag(np, OF_DETACHED);
254
255out_unlock:
256 write_unlock_irqrestore(&devtree_lock, flags);
257}
258
259#if defined(CONFIG_DEBUG_FS) && defined(DEBUG) 200#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
260static struct debugfs_blob_wrapper flat_dt_blob; 201static struct debugfs_blob_wrapper flat_dt_blob;
261 202
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 2ab9cbd98826..f384db815ea8 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -34,10 +34,6 @@ extern struct device_node *of_chosen;
34 34
35#define HAVE_ARCH_DEVTREE_FIXUPS 35#define HAVE_ARCH_DEVTREE_FIXUPS
36 36
37/* For updating the device tree at runtime */
38extern void of_attach_node(struct device_node *);
39extern void of_detach_node(struct device_node *);
40
41#ifdef CONFIG_PPC32 37#ifdef CONFIG_PPC32
42/* 38/*
43 * PCI <-> OF matching functions 39 * PCI <-> OF matching functions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1ed2ec2ea05b..f954c718d7eb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -817,65 +817,6 @@ struct device_node *of_find_next_cache_node(struct device_node *np)
817 return NULL; 817 return NULL;
818} 818}
819 819
820/*
821 * Plug a device node into the tree and global list.
822 */
823void of_attach_node(struct device_node *np)
824{
825 unsigned long flags;
826
827 write_lock_irqsave(&devtree_lock, flags);
828 np->sibling = np->parent->child;
829 np->allnext = allnodes;
830 np->parent->child = np;
831 allnodes = np;
832 write_unlock_irqrestore(&devtree_lock, flags);
833}
834
835/*
836 * "Unplug" a node from the device tree. The caller must hold
837 * a reference to the node. The memory associated with the node
838 * is not freed until its refcount goes to zero.
839 */
840void of_detach_node(struct device_node *np)
841{
842 struct device_node *parent;
843 unsigned long flags;
844
845 write_lock_irqsave(&devtree_lock, flags);
846
847 parent = np->parent;
848 if (!parent)
849 goto out_unlock;
850
851 if (allnodes == np)
852 allnodes = np->allnext;
853 else {
854 struct device_node *prev;
855 for (prev = allnodes;
856 prev->allnext != np;
857 prev = prev->allnext)
858 ;
859 prev->allnext = np->allnext;
860 }
861
862 if (parent->child == np)
863 parent->child = np->sibling;
864 else {
865 struct device_node *prevsib;
866 for (prevsib = np->parent->child;
867 prevsib->sibling != np;
868 prevsib = prevsib->sibling)
869 ;
870 prevsib->sibling = np->sibling;
871 }
872
873 of_node_set_flag(np, OF_DETACHED);
874
875out_unlock:
876 write_unlock_irqrestore(&devtree_lock, flags);
877}
878
879#ifdef CONFIG_PPC_PSERIES 820#ifdef CONFIG_PPC_PSERIES
880/* 821/*
881 * Fix up the uninitialized fields in a new device node: 822 * Fix up the uninitialized fields in a new device node: