]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fdtdec: Reorder fdtdec_set_carveout() parameters for consistency
authorThierry Reding <treding@nvidia.com>
Fri, 3 Sep 2021 13:16:20 +0000 (15:16 +0200)
committerTom Warren <twarren@nvidia.com>
Wed, 13 Oct 2021 21:18:30 +0000 (14:18 -0700)
The fdtdec_set_carveout() function's parameters are inconsistent with
the parameters passed to fdtdec_add_reserved_memory(). Fix up the order
to make it more consistent.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
board/nvidia/p2371-2180/p2371-2180.c
board/nvidia/p2771-0000/p2771-0000.c
board/nvidia/p3450-0000/p3450-0000.c
include/fdtdec.h
lib/fdtdec.c
lib/fdtdec_test.c
test/dm/fdtdec.c

index 58077255d0731989c55d2a248a7766adb7edca22..bc0a133725edfa7aa248c57cccef00202d8871ca 100644 (file)
@@ -138,8 +138,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node)
                return err;
        }
 
-       err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer",
-                                 NULL, 0, &fb);
+       err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb,
+                                 "framebuffer", NULL, 0);
        if (err < 0) {
                printf("failed to set carveout for %s: %d\n", node, err);
                return err;
index e35e6b6f48dc0ff373ca937132813505340852d7..cde5eff02f2a689229989893e4d4d81a1c6e5a5d 100644 (file)
@@ -114,8 +114,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node)
                return err;
        }
 
-       err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer",
-                                 NULL, 0, &fb);
+       err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb,
+                                 "framebuffer", NULL, 0);
        if (err < 0) {
                printf("failed to set carveout for %s: %d\n", node, err);
                return err;
index f16916460e67dcca7e4a6f1b5a1292edd810272a..e737fc1dab82bb8f21eb0f8b2b62bef2a183b04c 100644 (file)
@@ -137,8 +137,8 @@ static int ft_copy_carveout(void *dst, const void *src, const char *node)
                return err;
        }
 
-       err = fdtdec_set_carveout(dst, node, "memory-region", 0, "framebuffer",
-                                 NULL, 0, &fb);
+       err = fdtdec_set_carveout(dst, node, "memory-region", 0, &fb,
+                                 "framebuffer", NULL, 0);
        if (err < 0) {
                printf("failed to set carveout for %s: %d\n", node, err);
                return err;
index 5a6a7cbd995095e072b97074bf442205a7926ba2..d360d7bce4e133cd9837b0162cdbff7dcfd3ef51 100644 (file)
@@ -1110,16 +1110,16 @@ int fdtdec_get_carveout(const void *blob, const char *node,
  * @param prop_name    name of the property in which to store the phandle of
  *                     the carveout
  * @param index                index of the phandle to store
- * @param name         base name of the reserved-memory node to create
  * @param carveout     information about the carveout to add
+ * @param name         base name of the reserved-memory node to create
  * @param compatibles  compatible strings to set for the carveout
  * @param count                number of compatible strings
  * @return 0 on success or a negative error code on failure
  */
 int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
-                       unsigned int index, const char *name,
-                       const char **compatibles, unsigned int count,
-                       const struct fdt_memory *carveout);
+                       unsigned int index, const struct fdt_memory *carveout,
+                       const char *name, const char **compatibles,
+                       unsigned int count);
 
 /**
  * Set up the device tree ready for use
index f124f0555b340c65b00b44cd1e8651e1a323d401..a0ecc72b6cb5917a4cee4768c1801d1bd4079db4 100644 (file)
@@ -1523,9 +1523,9 @@ skip_compat:
 }
 
 int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name,
-                       unsigned int index, const char *name,
-                       const char **compatibles, unsigned int count,
-                       const struct fdt_memory *carveout)
+                       unsigned int index, const struct fdt_memory *carveout,
+                       const char *name, const char **compatibles,
+                       unsigned int count)
 {
        uint32_t phandle;
        int err, offset, len;
index 72c3001a210594272336d27ea54ecfe8965d2f06..3af9fb5da6041cb04fb05a54b03867f0528bdc7d 100644 (file)
@@ -189,8 +189,8 @@ static int make_fdt_carveout_device(void *fdt, uint32_t na, uint32_t ns)
        offset = CHECK(fdt_add_subnode(fdt, 0, name + 1));
        CHECK(fdt_setprop(fdt, offset, "reg", cells, (na + ns) * sizeof(*cells)));
 
-       return fdtdec_set_carveout(fdt, name, "memory-region", 0,
-                                  "framebuffer", NULL, 0, &carveout);
+       return fdtdec_set_carveout(fdt, name, "memory-region", 0, &carveout,
+                                  "framebuffer", NULL, 0);
 }
 
 static int check_fdt_carveout(void *fdt, uint32_t address_cells,
index 7b543e7b998e0bbff823617bae7705e425764314..385aa77a686f00a5f4a0b56ccef35c9889e81841 100644 (file)
@@ -28,21 +28,18 @@ static int dm_test_fdtdec_set_carveout(struct unit_test_state *uts)
 
        resv.start = 0x1000;
        resv.end = 0x2000;
-       ut_assertok(fdtdec_set_carveout(blob, "/a-test",
-                                       "memory-region", 2, "test_resv1",
-                                       NULL, 0, &resv));
+       ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 2,
+                                       &resv, "test_resv1", NULL, 0));
 
        resv.start = 0x10000;
        resv.end = 0x20000;
-       ut_assertok(fdtdec_set_carveout(blob, "/a-test",
-                                       "memory-region", 1, "test_resv2",
-                                       NULL, 0, &resv));
+       ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 1,
+                                       &resv, "test_resv2", NULL, 0));
 
        resv.start = 0x100000;
        resv.end = 0x200000;
-       ut_assertok(fdtdec_set_carveout(blob, "/a-test",
-                                       "memory-region", 0, "test_resv3",
-                                       NULL, 0, &resv));
+       ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 0,
+                                       &resv, "test_resv3", NULL, 0));
 
        offset = fdt_path_offset(blob, "/a-test");
        ut_assert(offset > 0);