]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fdt_support: delete force argument of fdt_chosen()
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Fri, 18 Apr 2014 08:41:00 +0000 (17:41 +0900)
committerTom Rini <trini@ti.com>
Thu, 19 Jun 2014 15:18:48 +0000 (11:18 -0400)
After all, we have realized "force" argument is completely
useless. fdt_chosen() 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>
common/cmd_fdt.c
common/fdt_support.c
common/image-fdt.c
include/fdt_support.h

index cc2b0e2dad2111877023cfbc6806da69d324f4e1..6831af4dedc5b76196be1722f227bc16352c2224 100644 (file)
@@ -581,7 +581,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        initrd_end = simple_strtoul(argv[3], NULL, 16);
                }
 
-               fdt_chosen(working_fdt, 1);
+               fdt_chosen(working_fdt);
                fdt_initrd(working_fdt, initrd_start, initrd_end);
 
 #if defined(CONFIG_FIT_SIGNATURE)
index 321dd2a655f89f5166e87334ddb915667e986174..f5a5cdfe3d42d79edc93e9c6ae8664314bc3f1e0 100644 (file)
@@ -262,12 +262,11 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
        return 0;
 }
 
-int fdt_chosen(void *fdt, int force)
+int fdt_chosen(void *fdt)
 {
        int   nodeoffset;
        int   err;
        char  *str;             /* used to set string properties */
-       const char *path;
 
        err = fdt_check_header(fdt);
        if (err < 0) {
@@ -280,38 +279,25 @@ int fdt_chosen(void *fdt, int force)
        if (nodeoffset < 0)
                return nodeoffset;
 
-       /*
-        * Create /chosen properites that don't exist in the fdt.
-        * If the property exists, update it only if the "force" parameter
-        * is true.
-        */
        str = getenv("bootargs");
        if (str != NULL) {
-               path = fdt_getprop(fdt, nodeoffset, "bootargs", NULL);
-               if ((path == NULL) || force) {
-                       err = fdt_setprop(fdt, nodeoffset,
-                               "bootargs", str, strlen(str)+1);
-                       if (err < 0)
-                               printf("WARNING: could not set bootargs %s.\n",
-                                       fdt_strerror(err));
-               }
+               err = fdt_setprop(fdt, nodeoffset,
+                                 "bootargs", str, strlen(str)+1);
+               if (err < 0)
+                       printf("WARNING: could not set bootargs %s.\n",
+                              fdt_strerror(err));
        }
 
 #ifdef CONFIG_OF_STDOUT_VIA_ALIAS
-       path = fdt_getprop(fdt, nodeoffset, "linux,stdout-path", NULL);
-       if ((path == NULL) || force)
-               err = fdt_fixup_stdout(fdt, nodeoffset);
+       err = fdt_fixup_stdout(fdt, nodeoffset);
 #endif
 
 #ifdef OF_STDOUT_PATH
-       path = fdt_getprop(fdt, nodeoffset, "linux,stdout-path", NULL);
-       if ((path == NULL) || force) {
-               err = fdt_setprop(fdt, nodeoffset,
-                       "linux,stdout-path", OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1);
-               if (err < 0)
-                       printf("WARNING: could not set linux,stdout-path %s.\n",
-                               fdt_strerror(err));
-       }
+       err = fdt_setprop(fdt, nodeoffset, "linux,stdout-path",
+                         OF_STDOUT_PATH, strlen(OF_STDOUT_PATH)+1);
+       if (err < 0)
+               printf("WARNING: could not set linux,stdout-path %s.\n",
+                      fdt_strerror(err));
 #endif
 
        return err;
index 173d36206ae61b4337cd495ef656a68321e776b5..27a8a44eaad80d21247274f9e13a6d26fe3c49ab 100644 (file)
@@ -463,7 +463,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
        ulong *initrd_end = &images->initrd_end;
        int ret;
 
-       if (fdt_chosen(blob, 1) < 0) {
+       if (fdt_chosen(blob) < 0) {
                puts("ERROR: /chosen node create failed");
                puts(" - must RESET the board to recover.\n");
                return -1;
index add86104e3f082193522b95d46bb63fb412f4fb3..21d7b44453286cbf78904f4620cb4fdc172fd2e6 100644 (file)
@@ -16,7 +16,7 @@ u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
                                const char *prop, const u32 dflt);
 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_chosen(void *fdt);
 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);