From: Guenter Roeck Date: Tue, 15 Apr 2014 15:38:17 +0000 (-0700) Subject: of: Clean up of_update_property X-Git-Tag: firefly_0821_release~176^2~4033^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e7a62df8e8b4a5ecbbf4339b5b3671ae6582e50a;p=firefly-linux-kernel-4.4.55.git 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: Guenter Roeck Signed-off-by: Rob Herring --- diff --git a/drivers/of/base.c b/drivers/of/base.c index f72d19b7e5d2..6d4ee22708c9 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -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; }