Commit d81d96901eacfc9ffbe7c26a8d9b55d02b3fcb0c
Committed by
Simon Glass
1 parent
f2100f6f77
Exists in
smarc_8mq_lf_v2020.04
and in
9 other branches
fdtdec: Use fdt_setprop_u32() for fdtdec_set_phandle()
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>
Showing 2 changed files with 4 additions and 8 deletions Side-by-side Diff
include/fdtdec.h
... | ... | @@ -1029,7 +1029,10 @@ |
1029 | 1029 | * @param phandle phandle to set for the given node |
1030 | 1030 | * @return 0 on success or a negative error code on failure |
1031 | 1031 | */ |
1032 | -int fdtdec_set_phandle(void *blob, int node, uint32_t phandle); | |
1032 | +static inline int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) | |
1033 | +{ | |
1034 | + return fdt_setprop_u32(blob, node, "phandle", phandle); | |
1035 | +} | |
1033 | 1036 | |
1034 | 1037 | /** |
1035 | 1038 | * fdtdec_add_reserved_memory() - add or find a reserved-memory node |
lib/fdtdec.c
... | ... | @@ -1261,13 +1261,6 @@ |
1261 | 1261 | } |
1262 | 1262 | #endif |
1263 | 1263 | |
1264 | -int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) | |
1265 | -{ | |
1266 | - fdt32_t value = cpu_to_fdt32(phandle); | |
1267 | - | |
1268 | - return fdt_setprop(blob, node, "phandle", &value, sizeof(value)); | |
1269 | -} | |
1270 | - | |
1271 | 1264 | static int fdtdec_init_reserved_memory(void *blob) |
1272 | 1265 | { |
1273 | 1266 | int na, ns, node, err; |