fdt_support: delete force argument of fdt_initrd()
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Fri, 18 Apr 2014 08:40:59 +0000 (17:40 +0900)
committerTom Rini <trini@ti.com>
Thu, 19 Jun 2014 15:18:47 +0000 (11:18 -0400)
After all, we have realized "force" argument is completely
useless. fdt_initrd() was always called with force = 1.

We should always want to do the same thing
(set appropriate value to the property)
even if the property already exists.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
arch/microblaze/lib/bootm.c
common/cmd_fdt.c
common/fdt_support.c
common/image-fdt.c
include/fdt_support.h

index d60b307f6fd5c0f04f9f56dd3f43e1a6350c5eba..6977dd641aba734e23d599127e2a901bb2e397b8 100644 (file)
@@ -58,7 +58,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
        /* fixup the initrd now that we know where it should be */
        if (images->rd_start && images->rd_end && of_flat_tree)
                ret = fdt_initrd(of_flat_tree, images->rd_start,
-                                images->rd_end, 1);
+                                images->rd_end);
                if (ret)
                        return 1;
 
index a6744ed9c2509eb14cb441df45d4cb64974f385c..cc2b0e2dad2111877023cfbc6806da69d324f4e1 100644 (file)
@@ -582,7 +582,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                }
 
                fdt_chosen(working_fdt, 1);
-               fdt_initrd(working_fdt, initrd_start, initrd_end, 1);
+               fdt_initrd(working_fdt, initrd_start, initrd_end);
 
 #if defined(CONFIG_FIT_SIGNATURE)
        } else if (strncmp(argv[1], "che", 3) == 0) {
index 0fede8ea2ec8ac90ca771bf09dc0710d86f0d287..321dd2a655f89f5166e87334ddb915667e986174 100644 (file)
@@ -203,12 +203,11 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff)
 }
 #endif
 
-int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
+int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
 {
        int   nodeoffset, addr_cell_len;
        int   err, j, total;
        fdt64_t  tmp;
-       const char *path;
        uint64_t addr, size;
 
        /* find or create "/chosen" node. */
@@ -242,26 +241,22 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 
        addr_cell_len = get_cells_len(fdt, "#address-cells");
 
-       path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL);
-       if ((path == NULL) || force) {
-               write_cell((u8 *)&tmp, initrd_start, addr_cell_len);
-               err = fdt_setprop(fdt, nodeoffset,
-                       "linux,initrd-start", &tmp, addr_cell_len);
-               if (err < 0) {
-                       printf("WARNING: "
-                               "could not set linux,initrd-start %s.\n",
-                               fdt_strerror(err));
-                       return err;
-               }
-               write_cell((u8 *)&tmp, initrd_end, addr_cell_len);
-               err = fdt_setprop(fdt, nodeoffset,
+       write_cell((u8 *)&tmp, initrd_start, addr_cell_len);
+       err = fdt_setprop(fdt, nodeoffset,
+                         "linux,initrd-start", &tmp, addr_cell_len);
+       if (err < 0) {
+               printf("WARNING: could not set linux,initrd-start %s.\n",
+                      fdt_strerror(err));
+               return err;
+       }
+       write_cell((u8 *)&tmp, initrd_end, addr_cell_len);
+       err = fdt_setprop(fdt, nodeoffset,
                        "linux,initrd-end", &tmp, addr_cell_len);
-               if (err < 0) {
-                       printf("WARNING: could not set linux,initrd-end %s.\n",
-                               fdt_strerror(err));
+       if (err < 0) {
+               printf("WARNING: could not set linux,initrd-end %s.\n",
+                      fdt_strerror(err));
 
-                       return err;
-               }
+               return err;
        }
 
        return 0;
index ac4563f4a70f70d2e801edafe9dafb4b478517db..173d36206ae61b4337cd495ef656a68321e776b5 100644 (file)
@@ -489,7 +489,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
        /* Create a new LMB reservation */
        lmb_reserve(lmb, (ulong)blob, of_size);
 
-       fdt_initrd(blob, *initrd_start, *initrd_end, 1);
+       fdt_initrd(blob, *initrd_start, *initrd_end);
        if (!ft_verify_fdt(blob))
                return -1;
 
index ae010bb6248a5bd840166a0d32b9471b7988b1ac..add86104e3f082193522b95d46bb63fb412f4fb3 100644 (file)
@@ -17,7 +17,7 @@ u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
 u32 fdt_getprop_u32_default(const void *fdt, const char *path,
                                const char *prop, const u32 dflt);
 int fdt_chosen(void *fdt, int force);
-int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force);
+int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end);
 void do_fixup_by_path(void *fdt, const char *path, const char *prop,
                      const void *val, int len, int create);
 void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,