fdt_support: delete force argument of fdt_initrd()
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>
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index a6744ed..cc2b0e2 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -582,7 +582,7 @@
}
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) {
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 0fede8e..321dd2a 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -203,12 +203,11 @@
}
#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 @@
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;
diff --git a/common/image-fdt.c b/common/image-fdt.c
index ac4563f..173d362 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -489,7 +489,7 @@
/* 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;