aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/reconfig.c
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2012-10-02 12:55:01 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 17:43:54 -0500
commite81b3295bc54eb0d03f4cdfc8cbf72e731d1b402 (patch)
tree562c84116ff9b969512347a6ffd326fdfe3a9592 /arch/powerpc/platforms/pseries/reconfig.c
parent83dac59409387789b88bed40b1be86a8abc572be (diff)
powerpc+of: Add /proc device tree updating to of node add/remove
When adding or removing a device tree node we should also update the device tree in /proc/device-tree. This action is already done in the generic OF code for adding/removing properties of a node. This patch adds this functionality for nodes. Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/reconfig.c')
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 39f71fba9b38..f99f1ca8035b 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -23,48 +23,6 @@
23#include <asm/pSeries_reconfig.h> 23#include <asm/pSeries_reconfig.h>
24#include <asm/mmu.h> 24#include <asm/mmu.h>
25 25
26
27
28/*
29 * Routines for "runtime" addition and removal of device tree nodes.
30 */
31#ifdef CONFIG_PROC_DEVICETREE
32/*
33 * Add a node to /proc/device-tree.
34 */
35static void add_node_proc_entries(struct device_node *np)
36{
37 struct proc_dir_entry *ent;
38
39 ent = proc_mkdir(strrchr(np->full_name, '/') + 1, np->parent->pde);
40 if (ent)
41 proc_device_tree_add_node(np, ent);
42}
43
44static void remove_node_proc_entries(struct device_node *np)
45{
46 struct property *pp = np->properties;
47 struct device_node *parent = np->parent;
48
49 while (pp) {
50 remove_proc_entry(pp->name, np->pde);
51 pp = pp->next;
52 }
53 if (np->pde)
54 remove_proc_entry(np->pde->name, parent->pde);
55}
56#else /* !CONFIG_PROC_DEVICETREE */
57static void add_node_proc_entries(struct device_node *np)
58{
59 return;
60}
61
62static void remove_node_proc_entries(struct device_node *np)
63{
64 return;
65}
66#endif /* CONFIG_PROC_DEVICETREE */
67
68/** 26/**
69 * derive_parent - basically like dirname(1) 27 * derive_parent - basically like dirname(1)
70 * @path: the full_name of a node to be added to the tree 28 * @path: the full_name of a node to be added to the tree
@@ -149,9 +107,6 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
149 } 107 }
150 108
151 of_attach_node(np); 109 of_attach_node(np);
152
153 add_node_proc_entries(np);
154
155 of_node_put(np->parent); 110 of_node_put(np->parent);
156 111
157 return 0; 112 return 0;
@@ -179,8 +134,6 @@ static int pSeries_reconfig_remove_node(struct device_node *np)
179 return -EBUSY; 134 return -EBUSY;
180 } 135 }
181 136
182 remove_node_proc_entries(np);
183
184 pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np); 137 pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np);
185 of_detach_node(np); 138 of_detach_node(np);
186 139