From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] bootm: be more informative with oftrees
Date: Fri, 13 Apr 2012 15:08:37 +0200 [thread overview]
Message-ID: <1334322517-18705-1-git-send-email-s.hauer@pengutronix.de> (raw)
- print error message when the specified oftree cannot be opened
- move verbose info to top of function so that the information is
printed before something else fails.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/bootm.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/commands/bootm.c b/commands/bootm.c
index 4f174db..1e1dc52 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -154,9 +154,14 @@ static int bootm_open_oftree(struct image_data *data, char *oftree, int num)
int ret;
size_t size;
+ if (bootm_verbose(data))
+ printf("Loading oftree from '%s'\n", oftree);
+
ft = file_name_detect_type(oftree);
- if ((int)ft < 0)
+ if ((int)ft < 0) {
+ printf("failed to open %s: %s\n", oftree, strerror(-(int)ft));
return ft;
+ }
if (ft == filetype_uimage) {
#ifdef CONFIG_CMD_BOOTM_OFTREE_UIMAGE
@@ -196,9 +201,6 @@ static int bootm_open_oftree(struct image_data *data, char *oftree, int num)
file_type_to_string(ft));
}
- if (bootm_verbose(data))
- printf("Loading oftree from '%s'\n", oftree);
-
fdt = xrealloc(fdt, size + 0x8000);
fdt_open_into(fdt, fdt, size + 0x8000);
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2012-04-13 13:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334322517-18705-1-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox