diff options
author | Thierry Reding <treding@nvidia.com> | 2019-04-15 10:08:21 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-05-21 17:33:23 -0600 |
commit | 3bf2f15351e9533c9c99ebbdd93cafca30558b0d (patch) | |
tree | 0b8e6012e8a7b4d656b861455ff9b7e224affc46 /lib | |
parent | 089ff8eb669f8c8e98bff2a6ea4bb5fd9bf34d3b (diff) | |
download | u-boot-3bf2f15351e9533c9c99ebbdd93cafca30558b0d.tar.gz u-boot-3bf2f15351e9533c9c99ebbdd93cafca30558b0d.tar.bz2 u-boot-3bf2f15351e9533c9c99ebbdd93cafca30558b0d.zip |
fdtdec: Remove fdt_{addr,size}_unpack()
U-Boot already defines the {upper,lower}_32_bits() macros that have the
same purpose. Use the existing macros instead of defining new APIs.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdtdec.c | 8 | ||||
-rw-r--r-- | lib/fdtdec_test.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index fea44a9a8c..d0ba888973 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1300,6 +1300,7 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename, fdt32_t cells[4] = {}, *ptr = cells; uint32_t upper, lower, phandle; int parent, node, na, ns, err; + fdt_size_t size; char name[64]; /* create an empty /reserved-memory node if one doesn't exist */ @@ -1340,7 +1341,8 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename, * Unpack the start address and generate the name of the new node * base on the basename and the unit-address. */ - lower = fdt_addr_unpack(carveout->start, &upper); + upper = upper_32_bits(carveout->start); + lower = lower_32_bits(carveout->start); if (na > 1 && upper > 0) snprintf(name, sizeof(name), "%s@%x,%x", basename, upper, @@ -1374,7 +1376,9 @@ int fdtdec_add_reserved_memory(void *blob, const char *basename, *ptr++ = cpu_to_fdt32(lower); /* store one or two size cells */ - lower = fdt_size_unpack(carveout->end - carveout->start + 1, &upper); + size = carveout->end - carveout->start + 1; + upper = upper_32_bits(size); + lower = lower_32_bits(size); if (ns > 1) *ptr++ = cpu_to_fdt32(upper); diff --git a/lib/fdtdec_test.c b/lib/fdtdec_test.c index f6defe16c5..1f4f270540 100644 --- a/lib/fdtdec_test.c +++ b/lib/fdtdec_test.c @@ -155,11 +155,13 @@ static int make_fdt_carveout_device(void *fdt, uint32_t na, uint32_t ns) }; fdt32_t cells[4], *ptr = cells; uint32_t upper, lower; + fdt_size_t size; char name[32]; int offset; /* store one or two address cells */ - lower = fdt_addr_unpack(carveout.start, &upper); + upper = upper_32_bits(carveout.start); + lower = lower_32_bits(carveout.start); if (na > 1 && upper > 0) snprintf(name, sizeof(name), "%s@%x,%x", basename, upper, @@ -173,7 +175,9 @@ static int make_fdt_carveout_device(void *fdt, uint32_t na, uint32_t ns) *ptr++ = cpu_to_fdt32(lower); /* store one or two size cells */ - lower = fdt_size_unpack(carveout.end - carveout.start + 1, &upper); + size = carveout.end - carveout.start + 1; + upper = upper_32_bits(size); + lower = lower_32_bits(size); if (ns > 1) *ptr++ = cpu_to_fdt32(upper); |