diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-07 13:34:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-09 08:59:44 +0200 |
commit | f562646dc801435c6cd0d693046af615f0d3577b (patch) | |
tree | 06538ce1729d40220e880ac08b476381e1b36d81 /common/startup.c | |
parent | 0b494649fa46d00db9ffef75431f4ea3ed433bdb (diff) | |
download | barebox-f562646dc801435c6cd0d693046af615f0d3577b.tar.gz barebox-f562646dc801435c6cd0d693046af615f0d3577b.tar.xz |
startup: Print error message when initcall fails
There was a time when we used to panic when initcalls failed. Then
it was changed to totally ignore the return value. Instead, print
an error message now so that the user can get a clue when something
bad happened. So initcalls are now recommended to actually return
negative error codes when something fails.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/startup.c')
-rw-r--r-- | common/startup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/startup.c b/common/startup.c index b53bbef840..775f97ca87 100644 --- a/common/startup.c +++ b/common/startup.c @@ -100,7 +100,9 @@ void start_barebox (void) initcall < __barebox_initcalls_end; initcall++) { debug("initcall-> %pS\n", *initcall); result = (*initcall)(); - debug("initcall<- %pS (%d)\n", *initcall, result); + if (result) + pr_err("initcall %pS failed: %s\n", *initcall, + strerror(-result)); } debug("initcalls done\n"); |