summaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-04-15 08:38:17 -0700
committerRob Herring <robh@kernel.org>2014-04-15 15:21:22 -0500
commite7a62df8e8b4a5ecbbf4339b5b3671ae6582e50a (patch)
treea0181e6f191aca891fc9e208b3fc5aef821a5796 /drivers/of/base.c
parentf3afa2259457e46bbb6285bcc1032ecc0f76fdd7 (diff)
downloadlinux-e7a62df8e8b4a5ecbbf4339b5b3671ae6582e50a.tar.gz
linux-e7a62df8e8b4a5ecbbf4339b5b3671ae6582e50a.tar.bz2
linux-e7a62df8e8b4a5ecbbf4339b5b3671ae6582e50a.zip
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 <linux@roeck-us.net> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c10
1 files changed, 3 insertions, 7 deletions
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;
}