[PATCH] mark f_ops const in the inode
[pandora-kernel.git] / fs / proc / proc_devtree.c
index fb117b7..596b4b4 100644 (file)
@@ -81,6 +81,30 @@ void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop
        __proc_device_tree_add_prop(pde, prop);
 }
 
+void proc_device_tree_remove_prop(struct proc_dir_entry *pde,
+                                 struct property *prop)
+{
+       remove_proc_entry(prop->name, pde);
+}
+
+void proc_device_tree_update_prop(struct proc_dir_entry *pde,
+                                 struct property *newprop,
+                                 struct property *oldprop)
+{
+       struct proc_dir_entry *ent;
+
+       for (ent = pde->subdir; ent != NULL; ent = ent->next)
+               if (ent->data == oldprop)
+                       break;
+       if (ent == NULL) {
+               printk(KERN_WARNING "device-tree: property \"%s\" "
+                      " does not exist\n", oldprop->name);
+       } else {
+               ent->data = newprop;
+               ent->size = newprop->length;
+       }
+}
+
 /*
  * Process a node, adding entries for its children and its properties.
  */
@@ -112,9 +136,11 @@ void proc_device_tree_add_node(struct device_node *np,
                 * properties are quite unimportant for us though, thus we
                 * simply "skip" them here, but we do have to check.
                 */
+               spin_lock(&proc_subdir_lock);
                for (ent = de->subdir; ent != NULL; ent = ent->next)
                        if (!strcmp(ent->name, pp->name))
                                break;
+               spin_unlock(&proc_subdir_lock);
                if (ent != NULL) {
                        printk(KERN_WARNING "device-tree: property \"%s\" name"
                               " conflicts with node in %s\n", pp->name,