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>
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 6eec947..ac77a08 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -55,12 +55,8 @@
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 @@
}
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");