Skip to content

Commit

Permalink
of: Clean up of_update_property
Browse files Browse the repository at this point in the history
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: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Guenter Roeck authored and Rob Herring committed Apr 15, 2014
1 parent f3afa22 commit e7a62df
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,17 +1828,13 @@ int of_update_property(struct device_node *np, struct property *newprop)
next = &(*next)->next;
}
raw_spin_unlock_irqrestore(&devtree_lock, flags);
if (rc)
return rc;
if (!found)
return -ENODEV;

/* 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);

if (!found)
return -ENODEV;

return 0;
}

Expand Down

0 comments on commit e7a62df

Please sign in to comment.