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>
此提交包含在:
Dong Aisheng
2012-07-11 15:16:37 +10:00
提交者 Benjamin Herrenschmidt
父節點 b416c9a10b
當前提交 475d009429
共有 6 個檔案被更改,包括 25 行新增30 行删除

查看文件

@@ -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;