6 #include <linux/errno.h>
8 #include <linux/time.h>
11 #include <linux/stat.h>
12 #include <linux/string.h>
14 #include <linux/module.h>
15 #include <linux/slab.h>
17 #include <asm/uaccess.h>
20 static inline void set_node_proc_entry(
struct device_node *np,
23 #ifdef HAVE_ARCH_DEVTREE_FIXUPS
33 static int property_proc_show(
struct seq_file *
m,
void *
v)
48 .open = property_proc_open,
74 de, &property_proc_fops, pp);
78 if (!
strncmp(name,
"security-", 9))
89 __proc_device_tree_add_prop(pde, prop, prop->
name);
110 if (ent->
data == oldprop)
114 " does not exist\n", oldprop->
name);
127 static int duplicate_name(
struct proc_dir_entry *de,
const char *name)
132 spin_lock(&proc_subdir_lock);
141 spin_unlock(&proc_subdir_lock);
150 int fixup_len =
strlen(name) + 2 + 1;
155 if (fixed_name ==
NULL) {
157 "name \"%s\"\n", name);
162 size =
snprintf(fixed_name, fixup_len,
"%s#%d", name, i);
165 if (
size > fixup_len) {
172 if (duplicate_name(de, fixed_name)) {
179 "renamed to \"%s\"\n", np->
full_name, fixed_name);
195 set_node_proc_entry(np, de);
204 if (duplicate_name(de, p))
205 p = fixup_name(np, de, p);
220 if (duplicate_name(de, p))
221 p = fixup_name(np, de, p);
223 ent = __proc_device_tree_add_prop(de, pp, p);
237 if (proc_device_tree ==
NULL)
241 pr_debug(
"/proc/device-tree: can't find root\n");