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 <[email protected]>
Signed-off-by: Dong Aisheng <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
This commit is contained in:
Dong Aisheng 2012-07-11 15:16:37 +10:00 • committed by Benjamin Herrenschmidt
commit 475d009429
6 changed files with 25 additions and 30 deletions

View file

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