summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-06-22 07:54:04 (GMT)
committerSimon Glass <sjg@chromium.org>2017-07-11 16:08:20 (GMT)
commitcb7dbe1fb017f0a1ad050a9dc91ed2c10cb998e6 (patch)
tree7914861c6700b3dd883f6dbc95da40c29c8e6104 /drivers
parent252510ac69461c9fc7fa3ec25d655c6f56b0fa93 (diff)
downloadu-boot-fsl-qoriq-cb7dbe1fb017f0a1ad050a9dc91ed2c10cb998e6.tar.xz
dm: ofnode: simplify ofnode_read_prop()
The code inside the if-block is the same as of_get_property(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/ofnode.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 98c1186..d9441c8 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -434,17 +434,11 @@ int ofnode_decode_display_timing(ofnode parent, int index,
const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp)
{
- if (ofnode_is_np(node)) {
- struct property *prop;
-
- prop = of_find_property(ofnode_to_np(node), propname, lenp);
- if (!prop)
- return NULL;
- return prop->value;
- } else {
+ if (ofnode_is_np(node))
+ return of_get_property(ofnode_to_np(node), propname, lenp);
+ else
return fdt_getprop(gd->fdt_blob, ofnode_to_offset(node),
propname, lenp);
- }
}
bool ofnode_is_available(ofnode node)