of: remove /proc/device-tree
[firefly-linux-kernel-4.4.55.git] / drivers / of / base.c
index 11a3498502fc8dec3c3fd53575914ecd77c1a336..f12feaee40519788ffd878490d3cd14fcc8063bf 100644 (file)
@@ -273,11 +273,9 @@ static int __init of_init(void)
                __of_node_add(np);
        mutex_unlock(&of_aliases_mutex);
 
-#if !defined(CONFIG_PROC_DEVICETREE)
-       /* Symlink to the new tree when PROC_DEVICETREE is disabled */
+       /* Symlink in /proc as required by userspace ABI */
        if (of_allnodes)
                proc_symlink("device-tree", NULL, "/sys/firmware/devicetree/base");
-#endif /* CONFIG_PROC_DEVICETREE */
 
        return 0;
 }
@@ -1550,12 +1548,6 @@ int of_add_property(struct device_node *np, struct property *prop)
 
        __of_add_property_sysfs(np, prop);
 
-#ifdef CONFIG_PROC_DEVICETREE
-       /* try to add to proc as well if it was initialized */
-       if (np->pde)
-               proc_device_tree_add_prop(np->pde, prop);
-#endif /* CONFIG_PROC_DEVICETREE */
-
        return 0;
 }
 
@@ -1602,12 +1594,6 @@ int of_remove_property(struct device_node *np, struct property *prop)
 
        sysfs_remove_bin_file(&np->kobj, &prop->attr);
 
-#ifdef CONFIG_PROC_DEVICETREE
-       /* try to remove the proc node as well */
-       if (np->pde)
-               proc_device_tree_remove_prop(np->pde, prop);
-#endif /* CONFIG_PROC_DEVICETREE */
-
        return 0;
 }
 
@@ -1663,12 +1649,6 @@ int of_update_property(struct device_node *np, struct property *newprop)
        if (!found)
                return -ENODEV;
 
-#ifdef CONFIG_PROC_DEVICETREE
-       /* try to add to proc as well if it was initialized */
-       if (np->pde)
-               proc_device_tree_update_prop(np->pde, newprop, oldprop);
-#endif /* CONFIG_PROC_DEVICETREE */
-
        return 0;
 }
 
@@ -1703,22 +1683,6 @@ int of_reconfig_notify(unsigned long action, void *p)
        return notifier_to_errno(rc);
 }
 
-#ifdef CONFIG_PROC_DEVICETREE
-static void of_add_proc_dt_entry(struct device_node *dn)
-{
-       struct proc_dir_entry *ent;
-
-       ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde);
-       if (ent)
-               proc_device_tree_add_node(dn, ent);
-}
-#else
-static void of_add_proc_dt_entry(struct device_node *dn)
-{
-       return;
-}
-#endif
-
 /**
  * of_attach_node - Plug a device node into the tree and global list.
  */
@@ -1739,22 +1703,9 @@ int of_attach_node(struct device_node *np)
        raw_spin_unlock_irqrestore(&devtree_lock, flags);
 
        of_node_add(np);
-       of_add_proc_dt_entry(np);
        return 0;
 }
 
-#ifdef CONFIG_PROC_DEVICETREE
-static void of_remove_proc_dt_entry(struct device_node *dn)
-{
-       proc_remove(dn->pde);
-}
-#else
-static void of_remove_proc_dt_entry(struct device_node *dn)
-{
-       return;
-}
-#endif
-
 /**
  * of_detach_node - "Unplug" a node from the device tree.
  *
@@ -1810,7 +1761,6 @@ int of_detach_node(struct device_node *np)
        of_node_set_flag(np, OF_DETACHED);
        raw_spin_unlock_irqrestore(&devtree_lock, flags);
 
-       of_remove_proc_dt_entry(np);
        of_node_remove(np);
        return rc;
 }