diff options
author | Dong Aisheng <dong.aisheng@linaro.org> | 2012-07-11 09:16:37 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-07-11 09:26:51 +0400 |
commit | 475d0094293b51353e342d1198377967dbc48169 (patch) | |
tree | b10a01706dd433b93353600a00491ce62e385ec9 /fs/proc/proc_devtree.c | |
parent | b416c9a10baae6a177b4f9ee858b8d309542fbef (diff) | |
download | linux-475d0094293b51353e342d1198377967dbc48169.tar.xz |
of: Improve prom_update_property() function
prom_update_property() currently fails if the property doesn't
actually exist yet which isn't what we want. Change to add-or-update
instead of update-only, then we can remove a lot duplicated lines.
Suggested-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'fs/proc/proc_devtree.c')
-rw-r--r-- | fs/proc/proc_devtree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index 927cbd115e53..df7dd08d4391 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c @@ -101,6 +101,11 @@ void proc_device_tree_update_prop(struct proc_dir_entry *pde, { struct proc_dir_entry *ent; + if (!oldprop) { + proc_device_tree_add_prop(pde, newprop); + return; + } + for (ent = pde->subdir; ent != NULL; ent = ent->next) if (ent->data == oldprop) break; |