summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-11-06 21:03:27 +0000
committerGrant Likely <grant.likely@linaro.org>2014-03-11 20:48:32 +0000
commit8357041a69b368991d1b04d9f1d297f8d71e1314 (patch)
tree54bc523897eb6c72a95d06efea5c64833fbb51a4 /drivers
parent7e66c5c74f7348a96d5a3671f8cda4a478242679 (diff)
downloadlinux-8357041a69b368991d1b04d9f1d297f8d71e1314.tar.gz
linux-8357041a69b368991d1b04d9f1d297f8d71e1314.tar.bz2
linux-8357041a69b368991d1b04d9f1d297f8d71e1314.zip
of: remove /proc/device-tree
The same data is now available in sysfs, so we can remove the code that exports it in /proc and replace it with a symlink to the sysfs version. Tested on versatile qemu model and mpc5200 eval board. More testing would be appreciated. v5: Fixed up conflicts with mainline changes Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David S. Miller <davem@davemloft.net> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/Kconfig8
-rw-r--r--drivers/of/base.c52
2 files changed, 1 insertions, 59 deletions
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index ffdcb11f75fb..a46ac1b00032 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -7,14 +7,6 @@ config OF
menu "Device Tree and Open Firmware support"
depends on OF
-config PROC_DEVICETREE
- bool "Support for device tree in /proc"
- depends on PROC_FS && !SPARC
- help
- This option adds a device-tree directory under /proc which contains
- an image of the device tree that the kernel copies from Open
- Firmware or other boot firmware. If unsure, say Y here.
-
config OF_SELFTEST
bool "Device Tree Runtime self tests"
depends on OF_IRQ
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 3b70a468c8ab..ed3e70b84957 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -281,11 +281,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;
}
@@ -1690,12 +1688,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 (!rc && np->pde)
- proc_device_tree_add_prop(np->pde, prop);
-#endif /* CONFIG_PROC_DEVICETREE */
-
return rc;
}
@@ -1742,12 +1734,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;
}
@@ -1803,12 +1789,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;
}
@@ -1843,22 +1823,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.
*/
@@ -1880,22 +1844,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.
*
@@ -1951,7 +1902,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;
}