diff options
author | Simon Glass <sjg@chromium.org> | 2013-02-24 17:33:21 +0000 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2013-02-28 19:09:23 -0800 |
commit | bfc59966431e6335fd5be0589eec073902cc7bb3 (patch) | |
tree | 34674e10d633b07c11c5e715bc0779023346f5fd /common/cmd_fdt.c | |
parent | 8c86bbe00f927de0655a65e43344ca0678d1bc34 (diff) | |
download | u-boot-bfc59966431e6335fd5be0589eec073902cc7bb3.tar.gz |
Update set_working_fdt_addr() to use setenv_addr()
We might as well use this common function instead of repeating the same
code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_fdt.c')
-rw-r--r-- | common/cmd_fdt.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 6eec947fcb..ac77a08b77 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -55,12 +55,8 @@ struct fdt_header *working_fdt; void set_working_fdt_addr(void *addr) { - char buf[17]; - working_fdt = addr; - - sprintf(buf, "%lx", (unsigned long)addr); - setenv("fdtaddr", buf); + setenv_addr("fdtaddr", addr); } /* @@ -347,10 +343,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } if (subcmd[0] == 's') { /* get the num nodes at this level */ - char buf[11]; - - sprintf(buf, "%d", curIndex + 1); - setenv(var, buf); + setenv_ulong(var, curIndex + 1); } else { /* node index not found */ printf("libfdt node not found\n"); |