]> git.sur5r.net Git - u-boot/commitdiff
dm: ofnode: simplify ofnode_read_prop()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 22 Jun 2017 07:54:04 +0000 (16:54 +0900)
committerSimon Glass <sjg@chromium.org>
Tue, 11 Jul 2017 16:08:20 +0000 (10:08 -0600)
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>
drivers/core/ofnode.c

index 98c1186eff986a5ed4878042e3f231fe5d86fe7e..d9441c849f0e34a4b9d4265fc42a9c92a8052283 100644 (file)
@@ -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)