diff options
-rw-r--r-- | fs/proc/proc_devtree.c | 24 | ||||
-rw-r--r-- | include/linux/proc_fs.h | 5 |
2 files changed, 29 insertions, 0 deletions
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index fb117b74809e..9bdd077d6f55 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c | |||
@@ -81,6 +81,30 @@ void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop | |||
81 | __proc_device_tree_add_prop(pde, prop); | 81 | __proc_device_tree_add_prop(pde, prop); |
82 | } | 82 | } |
83 | 83 | ||
84 | void proc_device_tree_remove_prop(struct proc_dir_entry *pde, | ||
85 | struct property *prop) | ||
86 | { | ||
87 | remove_proc_entry(prop->name, pde); | ||
88 | } | ||
89 | |||
90 | void proc_device_tree_update_prop(struct proc_dir_entry *pde, | ||
91 | struct property *newprop, | ||
92 | struct property *oldprop) | ||
93 | { | ||
94 | struct proc_dir_entry *ent; | ||
95 | |||
96 | for (ent = pde->subdir; ent != NULL; ent = ent->next) | ||
97 | if (ent->data == oldprop) | ||
98 | break; | ||
99 | if (ent == NULL) { | ||
100 | printk(KERN_WARNING "device-tree: property \"%s\" " | ||
101 | " does not exist\n", oldprop->name); | ||
102 | } else { | ||
103 | ent->data = newprop; | ||
104 | ent->size = newprop->length; | ||
105 | } | ||
106 | } | ||
107 | |||
84 | /* | 108 | /* |
85 | * Process a node, adding entries for its children and its properties. | 109 | * Process a node, adding entries for its children and its properties. |
86 | */ | 110 | */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 74488e49166d..aa6322d45198 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -146,6 +146,11 @@ struct property; | |||
146 | extern void proc_device_tree_init(void); | 146 | extern void proc_device_tree_init(void); |
147 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); | 147 | extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); |
148 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); | 148 | extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); |
149 | extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, | ||
150 | struct property *prop); | ||
151 | extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, | ||
152 | struct property *newprop, | ||
153 | struct property *oldprop); | ||
149 | #endif /* CONFIG_PROC_DEVICETREE */ | 154 | #endif /* CONFIG_PROC_DEVICETREE */ |
150 | 155 | ||
151 | extern struct proc_dir_entry *proc_symlink(const char *, | 156 | extern struct proc_dir_entry *proc_symlink(const char *, |