diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-12-15 15:39:51 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-01-11 21:27:14 +0100 |
commit | cef082896d8b2082042f30bdfc952e3ae5c97aad (patch) | |
tree | 69ddf9a54128d97bef0bb649c222baf3a7ff039b /cmd/fdt.c | |
parent | 9c92ffd2888c79134ef418b38978c7f50fdb7bbf (diff) |
cmd: fdt: Print error message when fdt application fails
There are lots of reason why a FDT application might fail, the
error code might give an indication. Let the error code translate
in a error string so users can try to understand what went wrong.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'cmd/fdt.c')
-rw-r--r-- | cmd/fdt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/fdt.c b/cmd/fdt.c index b503357dc3a..e73db4e772a 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -644,6 +644,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) else if (strncmp(argv[1], "ap", 2) == 0) { unsigned long addr; struct fdt_header *blob; + int ret; if (argc != 3) return CMD_RET_USAGE; @@ -656,8 +657,11 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (!fdt_valid(&blob)) return CMD_RET_FAILURE; - if (fdt_overlay_apply(working_fdt, blob)) + ret = fdt_overlay_apply(working_fdt, blob); + if (ret) { + printf("fdt_overlay_apply(): %s\n", fdt_strerror(ret)); return CMD_RET_FAILURE; + } } #endif /* resize the fdt */ |