Commit e7a62df8 authored by Guenter Roeck's avatar Guenter Roeck Committed by Rob Herring

of: Clean up of_update_property

After searching for the old property, bail out with -ENODEV
if it was not found.

It is unnecessary to check if oldprop is NULL before removing
its binary file; the check was already done before.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent f3afa225
...@@ -1828,17 +1828,13 @@ int of_update_property(struct device_node *np, struct property *newprop) ...@@ -1828,17 +1828,13 @@ int of_update_property(struct device_node *np, struct property *newprop)
next = &(*next)->next; next = &(*next)->next;
} }
raw_spin_unlock_irqrestore(&devtree_lock, flags); raw_spin_unlock_irqrestore(&devtree_lock, flags);
if (rc) if (!found)
return rc; return -ENODEV;
/* Update the sysfs attribute */ /* Update the sysfs attribute */
if (oldprop) sysfs_remove_bin_file(&np->kobj, &oldprop->attr);
sysfs_remove_bin_file(&np->kobj, &oldprop->attr);
__of_add_property_sysfs(np, newprop); __of_add_property_sysfs(np, newprop);
if (!found)
return -ENODEV;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment