]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fdtdec: Use fdt_setprop_u32() for fdtdec_set_phandle()
authorThierry Reding <treding@nvidia.com>
Mon, 15 Apr 2019 08:08:20 +0000 (10:08 +0200)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Apr 2019 02:26:43 +0000 (20:26 -0600)
The fdt_setprop_u32() function does everything that we need, so we
really only use the function as a convenience wrapper, in which case it
can simply be a static inline function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
include/fdtdec.h
lib/fdtdec.c

index 266c58271f0bb627b8c69b4de6dd8e3d6bd9c90c..110aa6ab6dea81b8a036c13c65c2d55f66c6159f 100644 (file)
@@ -1029,7 +1029,10 @@ int fdtdec_setup_memory_banksize(void);
  * @param phandle      phandle to set for the given node
  * @return 0 on success or a negative error code on failure
  */
-int fdtdec_set_phandle(void *blob, int node, uint32_t phandle);
+static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
+{
+       return fdt_setprop_u32(blob, node, "phandle", phandle);
+}
 
 /**
  * fdtdec_add_reserved_memory() - add or find a reserved-memory node
index 9c9c30234732f09b8162414e12145373a23b6cc6..fea44a9a8c65d22cff39fd953328532e5b9b55aa 100644 (file)
@@ -1261,13 +1261,6 @@ __weak void *board_fdt_blob_setup(void)
 }
 #endif
 
-int fdtdec_set_phandle(void *blob, int node, uint32_t phandle)
-{
-       fdt32_t value = cpu_to_fdt32(phandle);
-
-       return fdt_setprop(blob, node, "phandle", &value, sizeof(value));
-}
-
 static int fdtdec_init_reserved_memory(void *blob)
 {
        int na, ns, node, err;