aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r--arch/powerpc/kernel/prom.c59
1 files changed, 0 insertions, 59 deletions
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: